Dro*_*idT 5 python pip easy-install
sudo easy_install pip
我在 Mac 上执行命令时遇到问题。我不在防火墙后面。我正在使用 python 版本 2.7.10。macOS Sierra 的版本是 10.12.4。这是我收到的错误:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
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/
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')
Run Code Online (Sandbox Code Playgroud)
brew
我找到了使用安装的解决方案pyenv
。解决方案在这里找到,但我只需要它使用时的零件pip
。
# Install PyEnv (https://github.com/pyenv/pyenv#installation)
$ brew update
$ brew install pyenv
# Initialize pyenv using bash_profile
$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi\nexport PATH="~/.pyenv/bin:$PATH"' >> ~/.bash_profile
# or using zshrc
$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi\nexport PATH="~/.pyenv/bin:$PATH"' >> ~/.zshrc
# restart the shell
$ exec "$SHELL"
# Install Python 2.7
$ pyenv install 2.7.14
$ pyenv local 2.7.14
Run Code Online (Sandbox Code Playgroud)
完成这些步骤后,我sudo easy_install pip
再次运行,发现了!有效。
归档时间: |
|
查看次数: |
6164 次 |
最近记录: |