在OSX 10.11.3中安装virtualenvwrapper的问题

时间:2016-02-20 13:07:18

标签: python macos bash opencv virtualenvwrapper

我是编程和python的新手,但已经学习了几个月。我的目标是为Python3.5.1安装openCV3。为此,我一直在关注本教程:http://www.pyimagesearch.com/2015/06/29/install-opencv-3-0-and-python-3-4-on-osx/

我的问题是我似乎无法正确安装virtualenvwrapper。当我重新加载我的.bash_profile时,终端告诉我“bash:/usr/local/bin/virtualenvwrapper.sh:没有这样的文件或目录”。

在安装阶段,终端返回以下内容:

Gwenns-New-MBP:~ gwennlaine$ pip3 install virtualenvwrapper
Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in ./Library/Python/2.7/lib/python/site-packages
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)
Requirement already satisfied (use --upgrade to upgrade): stevedore in ./Library/Python/2.7/lib/python/site-packages (from virtualenvwrapper)
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
  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/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 725, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 752, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 266, 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/kd/k4jl6x895ydcsk0mcx1pnvp40000gn/T/pip-A3qhrB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

我应该注意到我已经尝试了许多不同的这种/替代方法来安装它,并且现在花了两天时间在google上研究这个问题,但似乎没有任何工作!

对我做错了什么的想法?

提前致谢!

格温

2 个答案:

答案 0 :(得分:0)

看起来你正试图通过python 3安装virtualenvwrapper但osx它正在使用python 2.7。你安装了python3吗?

答案 1 :(得分:0)

所以,我非常厌倦了试图实现这一点,我走了另一条路。我安装了pyenv。然后我安装了pyenv-virtualenv和pyenv-virtualenvwrappers作为插件。这使我能够创建一个稳定且隔离的虚拟环境来安装和编译OPenCV3。与普通的virtualenv相比,有些命令是不同的,但总的来说,它实现了同样的目标!