2016-02-20 77 views
0

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

我的问题是我似乎无法正确安装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' 

我应该注意到我试图安装这么多不同的这种/替代方式,到现在已经花了两天时间在谷歌研究这个问题,但似乎没有任何工作!

有关我在做什么错的任何想法?

在此先感谢!

格温

回答

0

它看起来像你想通过Python 3安装virtualenvwrapper但OSX它使用Python 2.7。你有没有安装python3?

+0

是的,通过自制软件(Python 3.5.1)安装 –

+0

在命令行上做一个pip3,看看你是否得到正确版本的pip3 – fredstban

+0

它会返回“/ usr/local/bin/pip3”。它不应该这样说吗? –

0

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