2015-01-20 78 views
0

我有一個安裝了(默認情況下)安裝了Python 2.7.6和我安裝了Python 3.4.0的mac。如何指定使用Python 3的PIP版本(或爲什麼不是PIP工作)

我認爲我也可能安裝了多個PIP版本。 (當我運行PIP --version我得到pip 1.5.6 from /Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg (python 2.7)

但我知道,Python 3自帶1.5.4版本

所以,我的問題是:

A.如何才能知道我是否有多個版本pip已安裝

B.如果我確實安裝了多個版本,如何指定要使用哪個版本或安裝的軟件包位置ges應該去?

我試圖概括here(基本上使用pip-3.4),但我得到的建議command not found

原因這一切的是,試圖與pip安裝任何包的時候,竟然只是爲了更新(pip install --upgrade pip)我得到以下錯誤

Exception: 
Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main 
    status = self.run(options, args) 
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run 
    requirement_set.install(install_options, global_options, root=options.root_path) 
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1431, in install 
    requirement.uninstall(auto_confirm=True) 
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 598, in uninstall 
    paths_to_remove.remove(auto_confirm) 
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1836, in remove 
    renames(path, new_path) 
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 295, in renames 
    shutil.move(old, new) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move 
    rmtree(src) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 247, in rmtree 
    rmtree(fullname, ignore_errors, onerror) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 252, in rmtree 
    onerror(os.remove, fullname, sys.exc_info()) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 250, in rmtree 
    os.remove(fullname) 
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/EGG-INFO/dependency_links.txt' 

Storing debug log for failure in /Users/Startec/Library/Logs/pip.log 
+1

你嘗試過''pip3''嗎?另外,一般來說,您可以在終端中編寫命令的開始,然後按兩次選項卡 - 這將顯示可能的擴展列表。 (如果只有一個,它會在第一次按下後完成。) – mmdeas 2015-01-20 22:01:11

+0

您是否嘗試過pip3或pip3.4? – 2015-01-20 22:01:26

回答

1

就像python被鏈接到你的Python 2版本,pip被鏈接到Python 2的點子。

取而代之的是使用pip3,它應該指向活動的Python 3安裝(可通過python3訪問)。您也可以使用完整版本名稱,但不帶短劃線:pip3.4

+0

就是這樣。正如@mmdeas提到的那樣,按Tab鍵向我展示了我安裝的其他版本的pip,在這種情況下是'pip pip2 pip2.7 pip3 pip3.4' – Startec 2015-01-20 22:06:54