1
votes

i have a error in python code : 'from time import clock' ImportError: cannot import name 'clock' from 'time' (unknown location)

this not working in python 3.8 can someone help

3
There is no variable named clock in the time module. What you are trying to do? - Ekrem Dinçel

3 Answers

3
votes

time.clock is a method that has been deprecated since Python 3.3 and removed from Python 3.8 (see the Python 3.7 time documentation for more information), because its behaviour was dependent on the platform (it behaved differently on Unix compared to Windows). As the documentation suggests, you should use time.perf_counter() or time.process_time() instead. These are subtly different, see this Stack Overflow question for more details.

1
votes

This happens when you use Python 3.8 and passlib version lower than 1.7.2. Try running the command below. This might help.

pip install --upgrade passlib==1.7.2

If you don't have passlib installed, just try

pip install passlib==1.7.2
0
votes

Updating passlib worked for me

pip install passlib==1.7.2