How to speed up the installation of pip and conda

After installing python or anaconda, you will find that downloading packages is slow.
We need to switch the software source of pip or conda to the domestic mirror source, which can greatly speed up the download speed.

pip speed up

First open the pip configuration file

gedit ~/.pip/pip.conf

Write the following content and save it, so that pip can use Tsinghua source to download:

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

conda speed up

Open the conda configuration file

gedit ~/.condarc

Replace the content with this, let conda use the Tsinghua mirror source to download:

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
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
report_errors: false
auto_activate_base: false

Guess you like

Origin blog.csdn.net/TU_Dresden/article/details/128299341