有关mac os python无法安装pip

上了一个有关机器学习python的课程,然后试着捣鼓了一下 一点点问题

1、无法安装 pip 显示如下错误

appledeair:~ apple$ sudo easy_install pip
Password:
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’)

解决:按照其他CSDN博主的说法,直接从网址下载了 pip 的安装包
https://bootstrap.pypa.io

在 terminal 中
sudo python get-pip.py 就可以了

剩下的 python 库使用 pip 进行安装就可以了
sudo pip easy_install numpy
appledeair:Desktop apple$ sudo python get-pip.py
Password:
The directory ‘/Users/apple/Library/Caches/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
The directory ‘/Users/apple/Library/Caches/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Collecting pip
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 744kB/s
Collecting wheel
Downloading https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl (41kB)
100% |████████████████████████████████| 51kB 1.3MB/s
Installing collected packages: pip, wheel
Successfully installed pip-18.0 wheel-0.31.1

你可能感兴趣的:(python)