当前位置:网站首页>‘module‘ object is not callable错误
‘module‘ object is not callable错误
2022-07-07 09:17:00 【ITSOK_U】
python报错:TypeError: ‘module’ object is not callable(“模块”对象不可调用)
- 具体代码贴在下面,一直找不到是哪里出错,还以为是类名写错应该是小写啥的,最后回头一看原来是我自己的py文件名也是coverage.py。
import coverage
import unittest
if __name__ == "__main__":
# 实例化对象
cov = coverage.coverage()
# 开始分析
cov.start()```
- 这就造成了导入的模块和自己写的程序文件命名一样,这里显然导入的是自己写的这个文件模块,不是引入的coverage。
- 解决办法:更改程序文件名称,如下:鼠标选中程序文件右键,或者快捷键shift+F6,
边栏推荐
猜你喜欢
The use of list and Its Simulation Implementation
PostgreSQL中的表复制
JSON format query of MySQL
Mysql的json格式查询
IDEA快捷键大全
学习笔记|数据小白使用DataEase制作数据大屏
"Dream Cup" 2017 Jiangsu information and future primary school summer camp it expert PK program design questions
Transaction rolled back because it has been marked as rollback only
在我有限的软件测试经历里,一段专职的自动化测试经验总结
About the application of writing shell script JSON in JMeter
随机推荐
Go-Redis 中间件
Verilog realizes nixie tube display driver [with source code]
Case study of Jinshan API translation function based on retrofit framework
基于华为云IOT设计智能称重系统(STM32)
Drive HC based on de2115 development board_ SR04 ultrasonic ranging module [source code attached]
Unity determines whether the mouse clicks on the UI
JS add spaces to the string
Wallhaven壁纸桌面版
Arduino receives and sends strings
创意信息获2家机构调研:GreatDB 数据库已在9地部署
互联网协议
What if copying is prohibited?
软件设计之——“高内聚低耦合”
"Dream Cup" 2017 Jiangsu information and future primary school summer camp it expert PK program design questions
Go Slice 比较
Kitex retry mechanism
從色情直播到直播電商
VR development optimization
[untitled]
Arduino board description