【发布时间】:2021-05-29 21:10:51
【问题描述】:
我已尝试运行此代码:
from time import clock
def f2():
t1 = clock()
res = ' ' * 10**6
print('f2:', clock()-t1)
但得到了 Traceback:
from time import clock
ImportError: cannot import name 'clock' from 'time' (unknown location)
Python 在标准库中没有看到时间模块?
我尝试通过 pip 手动安装这个模块(是的,我知道它应该已经安装了。但是我还能做什么呢?)。我收到以下错误响应:
ERROR: Could not find a version that satisfies the requirement time
ERROR: No matching distribution found for time
尝试通过 PyCharm 安装模块也失败了 - 它只是运行 pip 并得到相同的错误。
【问题讨论】:
标签: pip pycharm python-module