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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章