ubuntu20 conda/pip/系统更换清华镜像源
sudo apt install ca-certificates
更改conda源
conda官方示例清华镜像源
出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url这个错误,直接重新配置源地址即可
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/ conda config --set show_channel_urls yes
查看已添加的源
conda config --show-sources
==> /home/lhw/.condarc <==
ssl_verify: true
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
添加pytorch
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ # 设置搜索时显示通道地址 conda config --set show_channel_urls yes
python更改镜像源
python更改镜像源win10
C:\Users\xx\pip,并新建文件pip.ini文件,pip文件内容如下:
[global]
timeout = 100
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
cd ~/.pip
如果不存在.pip则创建目录
mkdir ~/.pip
cd ~/.pip
sudo gedit ~/.pip/pip.conf
[global]
timeout = 100
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
安装python3.6以下版本时,pip install 出现
ValueError: Unable to determine SOCKS version from socks://127.0.0.1:1089/ 解决方案: printenv | grep all_proxy 显示:all_proxy=socks://127.0.0.1:1089/ export all_proxy="socks5://127.0.0.1:1089"
Ubuntu更改系统源
ubuntu官方示例清华镜像帮助文档
如果出现错误就把
https 更改成 http