本文最后更新于 179 天前,其中的信息可能已经有所发展或是发生改变。
conda/pip换清华源
可直接执行命令:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
或者直接修改~/.conndarc配置文件为以下内容
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
show_channel_urls: true
pip换源
修改主目录下的文件~/.pip/pip.conf
配置文件index-url
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
要是主目录下找不到.pip
目录的话,可以输入以下命令创建文件夹和pip.conf
文件
cd ~
mkdir .pip
cd .pip/
vim pip.conf
然后就可以添加index-url
了