Conda update source and source pip

Update conda source

Each system can be modified by the user directory under the .condarcfile:

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/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
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

You can add Anaconda Python free warehouse. Windows file paths C:\Users\yourname\.condarc, Mac file path /Users/yourname/.condarc, if there is no direct or unable to create named .condarcfiles, can be performed first conda config --set show_channel_urls yesand then modify the file after generation.

Update pip source

Tsinghua pypi mirror synchronization every 5 minutes.

temporary use

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

Note, simpleno less, is httpsnot thehttp

set as Default

After configuring pip upgrade to the latest version (> = 10.0.0):

pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

Pip will be generated, configuration files, Windows configuration file C:\Users\yourname\pip\pip.ini, Mac configuration file /Users/yourname/.config/pip/pip.conf, content

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

If the default source to pip poor network connection, using the temporary station to upgrade mirror pip:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U

reference

Guess you like

Origin www.cnblogs.com/VVingerfly/p/12046586.html