將pip的下載源換成國內的,速度會有很大的提高。html
下面是一些國內經常使用鏡像:阿里雲
阿里雲 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/url
下面有兩種換源的方式:spa
1.暫時換源(換成清華大學的鏡像):.net
pip install 模塊名 -i https://pypi.tuna.tsinghua.edu.cn/simple
2.永久換源(換成清華的鏡像)code
(1)文件管理器文件路徑地址欄敲:%APPDATA% 回車,快速進入 C:\Users\電腦用戶\AppData\Roaming 文件夾中htm
(2)在該目錄下建立pip文件夾blog
(3)在pip文件夾中建立名爲pip.ini的配置文件,並輸入配置內容,保存便可ip
[global] timeout = 6000 index-url = https://pypi.tuna.tsinghua.edu.cn/simple trusted-host = pypi.tuna.tsinghua.edu.cn
本文參考:get