Python3.8 异常AttributeError module ‘time‘ has no attribute ‘clock‘

简介: 笔记

你好,我是悦创。


出现异常:

在 Pycharm 中加 Python3.8 环境,调用 time.clock 出异常:AttributeError module 'time' has no attribute 'clock'


经过度娘,其原因:

Python3.8 不再支持 time.clock,但在调用时依然包含该方法;


有效处理:

用 time.perf_counter() 替换:

5.png6.png


5.png

目录
相关文章
|
Python
python的时间操作time
【10月更文挑战第18天】 python的时间操作time
364 5
|
Python
python Module使用
【10月更文挑战第14天】 python Module使用
463 35
|
Python
python的时间操作time-应用
【10月更文挑战第20天】 python模块time的函数使用。
278 7
|
Python
python的时间操作time-函数介绍
【10月更文挑战第19天】 python模块time的函数使用介绍和使用。
420 4
|
Linux Python
【Azure Function】Python Function部署到Azure后报错No module named '_cffi_backend'
ERROR: Error: No module named '_cffi_backend', Cannot find module. Please check the requirements.txt file for the missing module.
580 2
|
数据安全/隐私保护 Python
python学习十一:python常用模块使用,如 加密模块pyarmor,时间模块time等
这篇文章介绍了Python中两个常用模块的使用:加密模块pyarmor用于保护代码,以及时间模块time用于处理时间相关的功能。
1175 0
|
存储 编解码 iOS开发
Python模块操作:time—Clock Time(一)
Python模块操作:time—Clock Time(一)
378 0
|
存储 iOS开发 MacOS
Python模块操作:time—Clock Time(二)
Python模块操作:time—Clock Time(二)
434 0
|
开发者 Python
Python 时间处理与时区转换:深入探究 datetime、time 模块与 pytz 库的功能与应用
Python 时间处理与时区转换:深入探究 datetime、time 模块与 pytz 库的功能与应用
843 0
|
Python
30天拿下Python之time模块
30天拿下Python之time模块
348 0

推荐镜像

更多