python文件名不要跟模块名相同,报错AttributeError: 'module' object has no attribute 'Differ'
2015-03-18 10:50
696 查看
python中的文件都会生成pyc文件,包括模块也是这样,所以调用模块的时候,实际上会调用模块.pyc文件;在这个前提下,如果将文件名命名成跟模块名一样,在同一目录下就会生成一个跟模块名一样的pyc文件,系统就直接调用这个文件了,所以就会出现模块中属性错误,如AttributeError: 'module' object has no attribute 'Differ'
相关文章推荐
- [Python]attributeError:'module' object has no attribute 'dump'
- Python基础学习-'module' object has no attribute 'urlopen'解决方法
- python 使用scapy包告警WARNING: can't import layer inet: 'module' object has no attribute 'IPPROTO_IPIP'
- python文件名不要跟模块名相同,报错AttributeError: 'module' object has no attribute 'Differ'
- AttributeError 'module' object has no attribute 'handlers'--Python子模块导入问题
- 【Python学习】python不要使用任何模块名作为文件名(module 'xgboost' has no attribute 'DMatrix')
- AttributeError: 'module' object has no attribute 'handlers'--Python子模块导入问题
- python AttributeError: 'module' object has no attribute 'setdefaultencoding'
- service_identity 模块 AttributeError: 'module' object has no attribute 'Any'
- AttributeError: 'module' object has no attribute 'randint'
- python遇到AttributeError: 'str' object has no attribute '_getAssertEqualityFunc'问题解决过程
- AttributeError: 'module' object has no attribute 的解决方法
- [Python][转]Exception AttributeError: "'NoneType' object has no attribute
- openerp.cli.main() AttributeError: 'module' object has no attribute 'cli'
- AttributeError: 'module' object has no attribute 'maketrans'
- python : 'NoneType' object has no attribute 'recv'
- Debian (Jessie 8.0) 的修复pip AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'
- 《python核心编程》序列:字符串、列表和元组Python: Attribute Error - 'NoneType' object has no attribute
- yum错误'module' object has no attribute 'iterparse'解决方法
- web.py 直接使用示例代码,web.application报错, 'module' object has no attribute 'application',问题原因分析