2016-09-20 107 views
1

我嘗試在Mac上安裝virtualenvwrapper,並得到了經典蟒蛇捕獲22:對MAC的OSERROR安裝virtualenvwrapper:[錯誤1]不允許操作:

C02QPBHWFVH3MBP:~ ckc3153$ pip install virtualenvwrapper 
Collecting virtualenvwrapper 
    Using cached virtualenvwrapper-4.7.2.tar.gz 
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /Library/Python/2.7/site-packages (from virtualenvwrapper) 
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /Library/Python/2.7/site-packages (from virtualenvwrapper) 
Collecting stevedore (from virtualenvwrapper) 
    Using cached stevedore-1.17.1-py2.py3-none-any.whl 
Requirement already satisfied (use --upgrade to upgrade): pbr>=1.6 in /Library/Python/2.7/site-packages (from stevedore->virtualenvwrapper) 
Collecting six>=1.9.0 (from stevedore->virtualenvwrapper) 
    Using cached six-1.10.0-py2.py3-none-any.whl 
Installing collected packages: six, stevedore, virtualenvwrapper 
    Found existing installation: six 1.4.1 
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project. 
    Uninstalling six-1.4.1: 
Exception: 
Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/commands/install.py", line 317, in run 
    prefix=options.prefix_path, 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py", line 736, in install 
    requirement.uninstall(auto_confirm=True) 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 742, in uninstall 
    paths_to_remove.remove(auto_confirm) 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove 
    renames(path, new_path) 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/utils/__init__.py", line 267, in renames 
    shutil.move(old, new) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move 
    copy2(src, real_dst) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2 
    copystat(src, dst) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat 
    os.chflags(dst, st.st_flags) 
OSError: [Errno 1] Operation not permitted: '/var/folders/yq/9qfrf1td5t5fk8xyp0536v340000gn/T/pip-5lWnj3-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info' 

C02QPBHWFVH3MBP:~ ckc3153$ pip uninstall six 
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project. 
Uninstalling six-1.4.1: 
    /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info 
Proceed (y/n)? y 
Exception: 
Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/commands/uninstall.py", line 76, in run 
    requirement_set.uninstall(auto_confirm=options.yes) 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py", line 336, in uninstall 
    req.uninstall(auto_confirm=auto_confirm) 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 742, in uninstall 
    paths_to_remove.remove(auto_confirm) 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove 
    renames(path, new_path) 
    File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/utils/__init__.py", line 267, in renames 
    shutil.move(old, new) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move 
    copy2(src, real_dst) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2 
    copystat(src, dst) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat 
    os.chflags(dst, st.st_flags) 
OSError: [Errno 1] Operation not permitted: '/var/folders/yq/9qfrf1td5t5fk8xyp0536v340000gn/T/pip-SGBRs3-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info' 

皮普無法卸載六,但可以」在那裏安裝6個包裝。用手卸載六次失敗的方式相同。

回答

1
  1. 使用sudo pip install virtualenvwrapper命令。
  2. 輸入當前用戶的密碼。
+0

不起作用,人們說這是危險的,這就是爲什麼MAC不允許sudo的點子了 – codyc4321

+0

錯誤消息,一個是相同的,雖然 – codyc4321

+0

嘗試做這個'pip install --ignore-installed six'。參考https://github.com/pypa/pip/issues/3165 –

8

參考this答案

sudo pip install virtualenvwrapper --ignore-installed six 
相關問題