我正在尝试安装pip
:
$ sudo easy_install pip
收到此错误:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')
我已经检查了 python 是否已安装:
$ python --version
Python 2.7.10
根据多个线程,这应该可以正常工作,我做错了什么?
下载 https://bootstrap.pypa.io/get-pip.py 并运行后:
python get-pip.py
我收到此错误:
Exception:
Traceback (most recent call last):
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/req/req_set.py", line 784, in install
**kwargs
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
最佳答案
为什么不遵循官方文档?
To install pip, securely download get-pip.py. 2
Then run the following:
$ python get-pip.py
以及指向 get-pip.py 的实际链接
如果你想在你的机器上安装特定的Python版本 python2.7或python3.x而不是python。
关于python - 无法使用 easy_install 安装 pip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49427239/