pip使用國內源配置
阿新 • • 發佈:2021-01-07
參考:https://blog.csdn.net/lrs1353281004/article/details/90745219
使用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源
pip install tensorflow_gpu==1.12.0 -ihttps://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\username\pip,新建檔案pip.ini,內容如下
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple