python 报错 AttributeError: module ‘time‘ has no attribute ‘clock 解决方法
源码如下:
#引入所需要的时间库
import datetime
import time#程序计时器,启动计时器
start = time.clock()#中间是放置需要测试运行时间的程序代码#计算启动时间和结束时间的时间差
end = time.clock()
print('运行时间 : %s 秒'%(end-start))
报错 AttributeError module 'time' has no attribute 'clock'
解决方法:python3.8不支持 clock 了,用 time.perf_counter() 替换就可以了
python 报错 AttributeError: module ‘time‘ has no attribute ‘clock 解决方法相关推荐
- python中引入包的时候报错AttributeError: module ‘sys‘ has no attribute ‘setdefaultencoding‘解决方法?
python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法? 参考文章: (1)pyth ...
- python导入自定义模块报attributeerror_Python脚本报错AttributeError: ‘module’ src has no attribute’xxx’解决方法...
在跑论文源码时报出的错误,其中"src"是源码中的一个文件夹,同时是一个包(因为有_init_.py文件)整个项目文件组织如下: 出错的py文件在utils文件夹下,追踪定位出错代 ...
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
解决方法:xx.py文件名时,xx不要是python保留字 原理:因为使用了Python系统库的名字,所以在编译的时候才会产生.pyc文件. 正常的Python文件在编译运行的时候是不会产生.pyc文 ...
- Python脚本报错AttributeError: ‘module’ object has no attribute’get’解决方法
发现代码都没有错.后来是改成这样: def pprint():name=var.get()print(name) var=StringVar() Label(root,text='姓名:',font= ...
- 学习python-mysql:报错AttributeError: module 'MySQLdb' has no attribute 'cursors'
爬虫写入数据库时报错: AttributeError: module 'MySQLdb' has no attribute 'cursors' 解决方法: 引入 import MySQLdb.curs ...
- 第一:Python+Allure运行报错AttributeError: module ‘allure‘ has no attribute ‘severity_level‘
1.很多查询结果都是先卸载pytest-allure-adaptor,然后再安装allure-pytest pip3 uninstall pytest-allure-adaptor 2.pip3 in ...
- python报错AttributeError module ‘scipy.misc‘ has no attribute ‘imresize‘和 ‘imread‘
python报错AttributeError: module 'scipy.misc' has no attribute 'imresize'和 'imread' 报错原因:scipy版本过高 解决方 ...
- pyinstall :打包 .exe 文件报错AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘
有疑问的地方 参考博文 一.环境搭建 Python GUI图形化小工具编程学习-- PySide2 环境搭建(一) 二.实例演示 Python GUI图形化小工具编程学习-- Demo 实例演示(二) ...
- 【pycharm】pycharm上安装tensorflow,报错:AttributeError: module ‘pip‘ has no attribute ‘main‘ 解决方法
[pycharm]pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法 参考文章: (1) ...
最新文章
- BCE或能成为BCH的一个侧链
- 创建程序集时元数据失败 -- 拒绝访问_kubectl 创建 Pod 背后到底发生了什么?
- DNS视图及日志系统
- 密码学常用的算法填充模式_密码学的操作模式
- mysql字符集解释_MySQL字符集详解
- python中函数包括标准库函数吗_Python标准库:内置函数divmod(a, b)
- 密码学小知识(1):布隆过滤器(Bloom Filter)、混淆布隆过滤器(Garbled BF)和布谷鸟过滤器(Cuckoo Filter)
- 音视频-Video标签整理(属性、方法、事件)
- 虚拟vpc服务器搭建,服务器搭建vpc
- xftp、xshell安装出现1603错误解决,亲测有用
- [Excel函数] COUNT函数 | COUNTIF函数 | COUNTIFS函数
- 室内定位技术方案---Wifi、RFID、bluetooth、Zigbee
- 哪个省才是高考地狱模式?有你的省吗?
- LQ0018 顺子日期【枚举+日期】
- 初探微信小游戏(一)
- 原生js获取html元素属性,JS(原生js和jq方式)获取元素属性(自定义属性),删除属性(自定义属性)...
- 基于微信小程序的点餐系统 报告+任务书+开题报告+中期报告+中期PPT+项目源码(Java+MySQL)及数据库文件
- 我的世界1.14刷雪机java版_我的世界全自动刷雪机图文攻略
- 京东万象行驶证识别api
- 021-C++中野指针