当前位置:网站首页>‘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,
边栏推荐
猜你喜欢

2021 summary and 2022 outlook
![Verilog design responder [with source code]](/img/91/6359a2f3fa0045b4a88956a475488c.png)
Verilog design responder [with source code]

2021-04-08
![[machine learning 03] Lagrange multiplier method](/img/14/7d4eb5679606e272f137ddbda4938c.png)
[machine learning 03] Lagrange multiplier method

Socket socket programming

自动化测试框架

科普达人丨一文弄懂什么是云计算?
![[C #] the solution of WinForm operation zoom (blur)](/img/66/b70213c95acd4ad9fe2eb739bd46b5.png)
[C #] the solution of WinForm operation zoom (blur)

Array object sorting

Input type= "password" how to solve the problem of password automatically brought in
随机推荐
Drive HC based on de2115 development board_ SR04 ultrasonic ranging module [source code attached]
Using ENSP to do MPLS pseudo wire test
Project ERROR: Unknown module(s) in QT: core gui
PR Lecture Notes
Ping tool ICMP message learning
A simple example of delegate usage
mif 文件格式记录
MPX plug-in
【pyqt】tableWidget里的cellWidget使用信号与槽机制
Activity生命周期
Basic knowledge of process (orphan, zombie process)
Transaction rolled back because it has been marked as rollback only
Still cannot find RPC dispatcher table failed to connect in virtual KD
Deconstruction and assignment of variables
从色情直播到直播电商
PostgreSQL中的表复制
Static semantic check of clang tidy in cicd
Input type= "password" how to solve the problem of password automatically brought in
Go slice comparison
Add a self incrementing sequence number to the antd table component