2016-02-20 73 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相比有所不同,但總的來說,它實現了相同的目的!