【发布时间】:2015-01-20 21:56:42
【问题描述】:
我有一台同时安装了Python 2.7.6(默认)和Python 3.4.0(由我安装)的mac。
我认为我可能还安装了多个版本的 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.如果我确实安装了多个版本,我该如何指定要使用哪个版本,或者安装的软件包应该放在哪里?
我已经尝试了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
【问题讨论】:
-
你试过
pip3吗?此外,一般来说,您可以在终端中编写命令的开头并按两次 Tab 键——这将显示可能的扩展列表。 (如果只有一个,它会在第一次按下后完成。) -
你试过pip3还是pip3.4?
标签: python python-2.7 python-3.x pip