1. 程式人生 > >python包管理器修改映象地址

python包管理器修改映象地址

修改Conda映象地址:

配置 ~/.condarc(linux/Mac)或C:\Users\當前使用者名稱\.condarc:

channels:

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

show_channel_urls: true

修改pip映象地址:

臨時使用

在pip命令最後加引數:  -i  https://pypi.tuna.tsinghua.edu.cn/simple

永久修改

Linux下,修改 ~/.pip/pip.conf (沒有就建立一個資料夾及檔案), windows下,直接在user目錄中建立一個pip目錄,如:C:\Users\xx\pip,新建檔案pip.ini。

內容如下:

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

[install] trusted-host=mirrors.aliyun.com

其他映象地址

新版ubuntu要求使用https源,要注意。

清華:https://pypi.tuna.tsinghua.edu.cn/simple

阿里雲:http://mirrors.aliyun.com/pypi/simple/

中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/

華中理工大學:http://pypi.hustunique.com/

豆瓣:http://pypi.douban.com/simple/