python pip換源

python pip換源

從官方渠道下載numpy和在cmd界面通過pip install ~命令安裝會發現速度特別慢。

 

小編髮現可以通過換源的方式提升下載速度:

一次性換源:

以numpy爲例:pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/ 

 

永久換源:

在我的電腦地址欄輸%APPDATA%

新建文件夾名爲pip

創建文件pip.ini

文件內容爲

[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn

 

pip國內鏡像源:

  阿里雲 http://mirrors.aliyun.com/pypi/simple/ 
  中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/ 
  豆瓣(douban) http://pypi.douban.com/simple/ 
  清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/ 
  中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/

 

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