1. 程式人生 > >安裝程序遇阻時的自查思路

安裝程序遇阻時的自查思路

mirror ade windows系統 rap 永久 width 技術 清華 yun

一、權限:Linux下root,Windows下管理員。

二、Python相關

1、pip更新

~# python -m pip install --upgrade pi

2、更換pip源

國內鏡像

清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
阿裏雲 http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣

http://pypi.douban.com/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 (沒有就創建一個), 內容如下:

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

Windows系統:

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

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

3、

安裝程序遇阻時的自查思路