Python错误AttributeError: 'module' object has no attribute 'copy'
2017-12-14 19:43
1836 查看
Traceback (most recent call last):
File “/Users/fujikoli/scripts/test.py”, line 40, in
import matplotlib.pylab as plt
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/init.py”, line 123, in
import pyparsing
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py”, line 3260, in
_reBracketExpr = Literal(“[“) + Optional(“^”).setResultsName(“negate”) + Group( OneOrMore( _charRange | _singleChar ) ).setResultsName(“body”) + “]”
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py”, line 775, in setResultsName
newself = self.copy()
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py”, line 749, in copy
cpy = copy.copy( self )
AttributeError: ‘module’ object has no attribute ‘copy’
解决方案:
https://stackoverflow.com/questions/23418949/pygame-attributeerror-module-object-has-no-attribute-copy
从这里发现问题的,我自己在运行的脚本的目录下命名了一个copy.py,导致与系统的冲突了,应该把自己的重命名。
File “/Users/fujikoli/scripts/test.py”, line 40, in
import matplotlib.pylab as plt
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/init.py”, line 123, in
import pyparsing
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py”, line 3260, in
_reBracketExpr = Literal(“[“) + Optional(“^”).setResultsName(“negate”) + Group( OneOrMore( _charRange | _singleChar ) ).setResultsName(“body”) + “]”
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py”, line 775, in setResultsName
newself = self.copy()
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py”, line 749, in copy
cpy = copy.copy( self )
AttributeError: ‘module’ object has no attribute ‘copy’
解决方案:
https://stackoverflow.com/questions/23418949/pygame-attributeerror-module-object-has-no-attribute-copy
从这里发现问题的,我自己在运行的脚本的目录下命名了一个copy.py,导致与系统的冲突了,应该把自己的重命名。
相关文章推荐
- python 错误解析 AttributeError: 'module' object has no attribute 'dumps'
- [python错误]builtins.AttributeError: 'module' object has no attribute 'request'
- python错误:AttributeError: 'module' object has no attribute 'setdefaultencoding'问题的解决方法
- python错误:AttributeError: 'module' object has no attribute 'setdefaultencoding'问题的解决方法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- Python3下错误AttributeError: ‘dict’ object has no attribute’iteritems‘的分析与解决
- 【python学习笔记(2)】脚本报错"AttributeError: 'module' object has no attribute 'xxx'"解决方法
- python opencv:AttributeError: 'module' object has no attribute 'cv' FOURCC
- Python Matplotlib AttributeError: 'module' object has no attribute 'popall'
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- Python脚本报错AttributeError: ‘module’ object has no attribute ’urllibopen'(Python 2.7.11 )
- 解决Python报错: AttributeError: 'module' object has no attribute '_base'
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- Python AttributeError: 'module' object has no attribute xxxx
- python大坑:AttributeError: 'module' object has no attribute 'Workbook'
- python 提示错误AttributeError: type object 'str' has no attribute '_name_'
- Python3.6 下yield的常见错误(AttributeError: 'generator' object has no attribute 'next')
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- PyQt5系列(三)Python3.x AttributeError: module 'string' has no attribute 'maketrans'错误解决
- 【Python错误】AttributeError: 'bool' object has no attribute '__call__'