Hello Guys, How are you all? Hope You all Are Fine. Today I am just importing Crypto.PublicKey in my code But I am facing following error AttributeError: module ‘time’ has no attribute ‘clock’ in python. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How AttributeError: module ‘time’ has no attribute ‘clock’ Error Occurs ?
I am just importing Crypto.PublicKey in my code But I am facing following error.
AttributeError: module 'time' has no attribute 'clock'
How To Solve AttributeError: module ‘time’ has no attribute ‘clock’ Error ?
How To Solve AttributeError: module ‘time’ has no attribute ‘clock’ Error ?
To Solve AttributeError: module ‘time’ has no attribute ‘clock’ Error If You are using PyCrypto then PyCrypto is dead so that you need to use PyCryptodome instead of PyCrypto. First of uninstall PyCrypto with this command. pip3 uninstall PyCrypto Just use these command to install PyCryptodome. pip3 install -U PyCryptodome. Second solution is
time.clock()
has been removed. So that Use below instaed of time.clock(). Use time.perf_counter() OR time.process_time().AttributeError: module ‘time’ has no attribute ‘clock’
To Solve AttributeError: module ‘time’ has no attribute ‘clock’ Error If You are using PyCrypto then PyCrypto is dead so that you need to use PyCryptodome instead of PyCrypto. First of uninstall PyCrypto with this command. pip3 uninstall PyCrypto Just use these command to install PyCryptodome. pip3 install -U PyCryptodome. Second solution is
time.clock()
has been removed. So that Use below instaed of time.clock(). Use time.perf_counter() OR time.process_time().
Solution 1: Use PyCryptodome instead of PyCrypto
If You are using PyCrypto then PyCrypto is dead so that you need to use PyCryptodome instead of PyCrypto. First of uninstall PyCrypto with this command.
pip3 uninstall PyCrypto
Just use these command to install PyCryptodome.
pip3 install -U PyCryptodome
Solution 2: time.clock()
has been removed
Here time.clock()
has been removed. So that Use below instaed of time.clock(). Use
time.perf_counter()
OR
time.process_time()
Solution 3: time.clock replace with time.time
- Just Find C:\Users\ssc\anaconda3\envs\pythonProject2\Lib\site-packages\sqlalchemy\util this folder.
- select compat.py file and Open.
- search for
time.clock
in compat.py - Then replace
time.clock
withtime.time
- and save it.
- Now your error should be solved.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
Thanks a lot for these helpfull informations !
My pleasure to help You. Thank You For your valuable comment.