PIP更換國內鏡像(轉)

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/

修改源方法:

臨時使用: 
可以在使用pip的時候在後面加上-i參數,指定pip源 
eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple

永久修改: 
linux: 
修改 ~/.pip/pip.conf (沒有就創建一個), 內容如下:


 
  1. [global]

  2. index-url = https://pypi.tuna.tsinghua.edu.cn/simple

windows: 
直接在user目錄中創建一個pip目錄,如:C:\Users\xx\pip,新建文件pip.ini,內容如下


 
  1. [global]

  2. index-url = https://pypi.tuna.tsinghua.edu.cn/simple

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