折腾:
【未解决】Mac中pyenv设置系统python版本为3.7
期间,去用pyenv安装python:

日志:
1 2 3 4 5 | ➜ ~ pyenv install 3.7.3 python-build: use openssl from homebrew python-build: use readline from homebrew Downloading Python-3.7.3. tar .xz... -> https: //www .python.org /ftp/python/3 .7.3 /Python-3 .7.3. tar .xz |
pyenv install太慢
所以参考
去换源,看看能否加速下载和安装
1 2 3 4 5 6 7 | ➜ ~ mkdir ~/.pip ➜ ~ vim ~/.pip /pip .conf ➜ ~ cat ~/.pip /pip .conf [global] index-url = http: //mirrors .aliyun.com /pypi/simple/ [ install ] trusted-host=mirrors.aliyun.com |
此办法,并不能给pyenv install更换源以加速
等后续看看pip安装的时,是否换了源,是否加了速度
后来:
【未解决】Mac中给Python 3.7中安装python库numpy和pandas
期间,确认pip的源生效了,换成aliyun的地址了,下载速度很快:
1 2 3 4 5 6 7 8 9 | ➜ ~ pip3 install numpy pandas Looking in indexes: http: //mirrors .aliyun.com /pypi/simple/ Collecting numpy Downloading http: //mirrors .aliyun.com /pypi/packages/2f/5b/2cc2b9285e8b2ca8d2c1e4a2cbf1b12d70a2488ea78170de1909bca725f2/numpy-1 .18.1-cp37-cp37m-macosx_10_9_x86_64.whl (15.1MB) 100% |████████████████████████████████| 15.1MB 1.1MB /s Collecting pandas Downloading http: //mirrors .aliyun.com /pypi/packages/ab/ba/f97030b7e8ec0a981abdca173de4e727b3a7b4ed5dba492f362ba87d59a2/pandas-1 .0.1-cp37-cp37m-macosx_10_9_x86_64.whl (9.8MB) 100% |████████████████████████████████| 9.8MB 1.3MB /s ... |
效果很不错。
【总结】
此处想要给pip全局下载加速,可以更换源。
做法:
1 2 | mkdir ~/.pip vim ~/.pip /pip .conf |
保存内容:
1 2 3 4 | [global] index-url = http: //mirrors .aliyun.com /pypi/simple/ [ install ] trusted-host=mirrors.aliyun.com |
即可-》后续pip下载时,就会从
下载,速度很快。
后记:
貌似其他源也可以,比如:
->
抽空试试
以及:
说的其他源:
- 豆瓣:http://pypi.douban.com
- 阿里云:http://mirrors.aliyun.com/pypi/simple
- 清华大学:https://pypi.tuna.tsinghua.edu.cn/simple
转载请注明:在路上 » 【已解决】Mac中给pip更换源以加速下载