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
260 5
|
Python
python Module使用
【10月更文挑战第14天】 python Module使用
320 35
|
Python
python的时间操作time-应用
【10月更文挑战第20天】 python模块time的函数使用。
141 7
|
Python
python的时间操作time-函数介绍
【10月更文挑战第19天】 python模块time的函数使用介绍和使用。
275 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.
370 2
|
数据安全/隐私保护 Python
python学习十一:python常用模块使用,如 加密模块pyarmor,时间模块time等
这篇文章介绍了Python中两个常用模块的使用:加密模块pyarmor用于保护代码,以及时间模块time用于处理时间相关的功能。
778 0
|
存储 编解码 iOS开发
Python模块操作:time—Clock Time(一)
Python模块操作:time—Clock Time(一)
198 0
|
6月前
|
数据采集 机器学习/深度学习 人工智能
Python:现代编程的首选语言
Python:现代编程的首选语言
824 102
|
6月前
|
数据采集 机器学习/深度学习 算法框架/工具
Python:现代编程的瑞士军刀
Python:现代编程的瑞士军刀
414 104
|
6月前
|
人工智能 自然语言处理 算法框架/工具
Python:现代编程的首选语言
Python:现代编程的首选语言
332 103