无法在OSX 10.11 El Capitan上安装virtualenvwrapper [英] Can't install virtualenvwrapper on OSX 10.11 El Capitan

查看:88
本文介绍了无法在OSX 10.11 El Capitan上安装virtualenvwrapper的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近擦除了Mac,重新安装了OSX El Capitan公共beta3.我用sudo easy_install pip安装了pip,并用sudo pip install virtualenv安装了virtualenv,没有任何问题.

I recently wiped my Mac and reinstalled OSX El Capitan public beta 3. I installed pip with sudo easy_install pip and installed virtualenv with sudo pip install virtualenv and did not have any problems.

现在,当我尝试sudo pip install virtualenvwrapper时,我得到以下信息:

Now, when I try to sudo pip install virtualenvwrapper, I get the following:

Users-Air:~ User$ sudo pip install virtualenvwrapper

The directory '/Users/User/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/User/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting virtualenvwrapper
  Downloading virtualenvwrapper-4.6.0-py2.py3-none-any.whl
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)
  Downloading stevedore-1.7.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pbr<2.0,>=1.3 in /Library/Python/2.7/site-packages (from stevedore->virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): argparse in /Library/Python/2.7/site-packages (from stevedore->virtualenvwrapper)
Collecting six>=1.9.0 (from stevedore->virtualenvwrapper)
  Downloading six-1.9.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-7.1.0-py2.7.egg/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py", line 299, in run
    root=options.root_path,
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_install.py", line 726, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_uninstall.py", line 125, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/utils/__init__.py", line 314, 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: '/tmp/pip-tTNnKQ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

由于问题似乎出在six软件包上,因此手动尝试使用sudo pip uninstall six卸载它会导致相同的错误.输出建议也使用-H标志,但是我仍然得到几乎相同的错误:

As the issue seems to be with the six package, manually trying to uninstall it with sudo pip uninstall six results in the same error. The output suggests using the -H flag as well, but I still get pretty much the same error:

Users-Air:~ User$ sudo -H pip install virtualenvwrapper
Collecting virtualenvwrapper
  Downloading virtualenvwrapper-4.6.0-py2.py3-none-any.whl
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)
  Downloading stevedore-1.7.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pbr<2.0,>=1.3 in /Library/Python/2.7/site-packages (from stevedore->virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): argparse in /Library/Python/2.7/site-packages (from stevedore->virtualenvwrapper)
Collecting six>=1.9.0 (from stevedore->virtualenvwrapper)
  Downloading six-1.9.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-7.1.0-py2.7.egg/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py", line 299, in run
    root=options.root_path,
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_install.py", line 726, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_uninstall.py", line 125, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/utils/__init__.py", line 314, 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: '/tmp/pip-fwQzor-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

我已禁用sudo nvram boot-args="rootless=0"的无根目录,但这没有任何效果.任何帮助将不胜感激!

I have disabled rootless with sudo nvram boot-args="rootless=0", and this has had no effect. Any help would be appreciated!

推荐答案

您可以手动安装现有的10.11安装中不存在的依赖项,然后使用--no-deps安装其他软件包以忽略这些依赖项.这样,它将跳过six(和已经安装的argparse).这适用于我的10.11 beta 6安装:

You can manually install the dependencies that don't exist on a stock 10.11 install, then install the other packages with --no-deps to ignore the dependencies. That way it will skip six (and argparse which is also already installed). This works on my 10.11 beta 6 install:

sudo pip install pbr
sudo pip install --no-deps stevedore
sudo pip install --no-deps virtualenvwrapper

并且无需禁用无根目录.

And no need to disable rootless.

这篇关于无法在OSX 10.11 El Capitan上安装virtualenvwrapper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆