linux:
修改 ~/.pip/pip.conf (沒有就創建一個), 內容如下:
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple
windows:
直接在user目錄中創建一個pip目錄,如:C:\Users\xx\pip,在pip 目錄下新建文件pip.ini,內容如下
或者按照網友的建議:win+R 打開用戶目錄%HOMEPATH%,在此目錄下創建 pip 文件夾,在 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/