当前位置: 首页 > 面试题库 >

无法在OSX 10.11 El Capitan上安装virtualenvwrapper

戚甫
2023-03-14
问题内容

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

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

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标志,但是我仍然得到几乎相同的错误:

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'

我已使用禁用了rootless sudo nvram boot-args="rootless=0",这没有任何效果。任何帮助,将不胜感激!


问题答案:

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

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

无需禁用无根。



 类似资料:
  • 问题内容: 我正在运行Linux(2.6.18-164.15.1.el5.centos.plus),并尝试安装pyodbc。我正在做pip install pyodbc并得到很长的错误列表,这些错误以 错误:命令“ gcc”失败,退出状态为1 我查看了 /root/.pip/pip.log ,看到了以下内容: InstallationError:命令/ usr / local / bin / py

  • 我试图在PyCharm上安装TensorFlow

  • 我试图通过克隆repo在mac os 10.13上安装Multicorn。在我的机器上,但得到错误,我还安装了mac os 10.13的xcode。 我得到的错误: Python的版本是2.7 clang-wall-Wwiness-原型-Wpoint er-arith-Wdisonation-post-语句-Wfalse=vla-Wendif-标签-Wwiness-forment-属性-Wform

  • 问题内容: 我安装了Python 2.7和NumPy。我已经下载了SciPy的预构建二进制文件,但是安装脚本因以下错误而失败: 找不到Blas库。可以在文件(部分)中指定搜索目录的目录,也可以通过设置BLAS环境变量来指定 目录。 我真的对这件事还不了解。我以为这是一个简单的安装过程,但事实并非如此。我用Google搜索了BLAS环境变量,但是找不到任何合适的变量。任何帮助表示赞赏。 麦克风 编辑

  • 进入插件部分后, 我继续进行常规安装: 但是在一些安装屏幕之后,netbean给了我这个错误: 这发生在加载一段时间后: 有人知道为什么会这样吗? 注意:我使用的是macOS Mojave

  • 我正在尝试在Linux机器上安装java。我通过 然后,我尝试了以下命令: tar zxvfjdk-7u72-linux-x64.tar.gz gzip:stdin:不是gzip格式tar:子返回状态1 tar:错误不可恢复:正在退出[root@localhost ~]# 有人能告诉我如何在Linux机器上安装java吗?我得到了上面的错误,我不知道如何解决它。

  • 问题内容: 我一直在尝试使用安装lxml ,但出现以下错误。我以前用过(在其他答案中建议),但我仍然遇到相同的错误。我没有使用control-c。 问题答案: 尝试以下操作来获得帮助: