2016-09-21 3 views
0

저는 최근 Python 2.7을 실행하는 Windows 2008 R2 서버에서 deepcopy 오류를 가져 왔습니다. 심지어 간단한 핍 -U 셀레늄을 설치Deepcopy pip install, pandas, selenium, everywhere에서 오류가 발생했습니다.

내가 파이썬 쉘에서() 명령 mydriver = webdriver.Firefox을 실행하면

Traceback (most recent call last): 
File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main 
"__main__", fname, loader, pkg_name) 
File "c:\python27\lib\runpy.py", line 72, in _run_code 
exec code in run_globals 
File "C:\Python27\Scripts\pip.exe\__main__.py", line 5, in <module> 
File "c:\python27\lib\site-packages\pip\__init__.py", line 14, in <module> 
from pip.utils import get_installed_distributions, get_prog 
File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 27, in <module> 
from pip._vendor import pkg_resources 
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 71, in <module> 
__import__('pip._vendor.packaging.requirements') 
File "c:\python27\lib\site-packages\pip\_vendor\packaging\requirements.py", line 9, in <module> 
from pip._vendor.pyparsing import (
File "c:\python27\lib\site-packages\pip\_vendor\pyparsing.py", line 3462, in <module> 
_reBracketExpr = Literal("[") + Optional("^").setResultsName("negate") + Group(OneOrMore(_charRange | _singleChar)).setResultsName("body") + "]" 
File "c:\python27\lib\site-packages\pip\_vendor\pyparsing.py", line 884, in setResultsName 
newself = self.copy() 
File "c:\python27\lib\site-packages\pip\_vendor\pyparsing.py", line 858, in copy 
cpy = copy.copy(self) 
AttributeError: 'module' object has no attribute 'copy' 

, 나는이 오류를 얻을이 오류를

Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py",line 51, in __init__ 
self.profile = firefox_profile or FirefoxProfile() 
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 67, in __init__ 
self.default_preferences = copy.deepcopy(
AttributeError: 'module' object has no attribute 'deepcopy' 

I을 제공합니다 판다를 가져 오는 동안 유사한 오류가 발생합니다.

답변

1

이 문제는 Python 스크립트를 실행하는 폴더에 copy.py 또는 copy.pyc이있을 때 발생할 수 있습니다. 따라서 import copy 일 때 실제로 작업 디렉토리에 copy.py을 가져옵니다. 파일 이름으로 copy.py을 사용하지 마십시오.

관련 문제