Windows環境下,在cmd中使用pip安裝包速度過慢的問題解決:
由於訪問的源是國外源,所以訪問速度慢,因此需要添加國內的相關源,比如常見的清華源、中科大源、豆瓣源:
清華:https://pypi.tuna.tsinghua.edu.cn/simple
豆瓣:http://pypi.douban.com/simple/
阿里雲:http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
華中理工大學:http://pypi.hustunique.com/
山東理工大學:http://pypi.sdutlinux.org/
在Windows下,直接在user
目錄中創建一個pip目錄,如在C:\Users\用戶名
下新建一個pip
文件夾:C:\Users\Administrator(用戶名)\pip
,新建文件pip.ini
,裏面使用如下內容:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple #這裏可以自由更換源地址(這裏使用的是清華)
[install]
trusted-host=mirrors.aliyun.com