pip安装包慢的问题

  • 今天安装阿里云的aliyun-python-sdk-core,想通过api查看账户余额之类的,但是安装太慢了(1个多小时了一个9M的包还没下完,从files.pythonhosted.org下载特别慢)。
  • 于是乎网上找到国内的源下载
#阿里云
http://mirrors.aliyun.com/pypi/simple/

#中国科技大学
https://pypi.mirrors.ustc.edu.cn/simple/

#豆瓣
http://pypi.douban.com/simple/

#清华大学
https://pypi.tuna.tsinghua.edu.cn/simple/

#中国科学技术大学
http://pypi.mirrors.ustc.edu.cn/simple/
  • 临时使用的命令加-i参数
sudo pip3.5 install  aliyun-python-sdk-core   -i https://pypi.tuna.tsinghua.edu.cn/simple/
  • 使用后下载贼快一下就安好了
    在这里插入图片描述
  • 如果想要设置为全局,一劳永逸
vim ~/.pip/pip.conf
  • 这里以配置阿里云的为例,写入内容
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章