![](/img/trans.png)
[英]AttributeError: not found module 'time' has no attribute 'clock'
[英]attributeerror module 'time' has no attribute 'clock' (pyqt5)
我知道time.clock()
自 Python 3.3 以来已被弃用。 但是,当我尝试导入 pyqtgraph 模块时发生错误:
import pyqtgraph
这是文件中唯一的一行,这是错误:
File "D:\2020Backup\2020Backup\code\Python\PyQt\graphs\first.py", line 1, in <module>
import pyqtgraph
File "C:\Users\mpnlo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyqtgraph\__init__.py", line 204, in <module>
from .graphicsItems.VTickGroup import *
File "C:\Users\mpnlo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyqtgraph\graphicsItems\VTickGroup.py", line 7, in <module>
from .. import functions as fn
File "C:\Users\mpnlo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyqtgraph\functions.py", line 17, in <module>
from . import debug
File "C:\Users\mpnlo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyqtgraph\debug.py", line 11, in <module>
from . import ptime
File "C:\Users\mpnlo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyqtgraph\ptime.py", line 24, in <module>
cstart = systime.clock() ### Required to start the clock in windows
AttributeError: module 'time' has no attribute 'clock'
我想知道是否有人知道此问题的解决方法,也许是我更新模块中错误的一种方法,我使用的是最新版本的 pyqtgraph。
使用pip3 install --upgrade git+http://github.com/pyqtgraph/pyqtgraph.git
安装最新版本
因此,如果您遇到这种情况,一种解决方法是使用集成到 pyqt5 中的 matplotlib 模块,此页面概述了如何执行此操作:
https://pythonspot.com/pyqt5-matplotlib/
我希望这有帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.