PIP and conda replace domestic installation source

conda replace the domestic installation source

Global

Anaconda is a Python distribution for scientific computing, supports Linux, Mac, Windows, and includes many popular scientific computing and data analysis Python packages.

The Anaconda installation package can be downloaded from https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/.

TUNA also provides a mirror image of the Anaconda warehouse and third-party sources (conda-forge, msys2, pytorch, etc., see the complete list). Each system can modify the .condarc file in the user directory. Windows users cannot directly create a file named .condarc, they can execute conda config --set show_channel_urls yes to generate the file and then modify it.

Note: Since the update is too fast and difficult to synchronize, we do not synchronize the three packages pytorch-nightly, pytorch-nightly-cpu, and ignite-nightly.

channels:
  - defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
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
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - 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

You can add the Anaconda Python free warehouse.

Run conda clean -i to clear the index cache and ensure that the index provided by the mirror station is used.

Run conda create -n myenv numpy to test it.

temporary

Install cuda:

conda install cudatoolkit=8.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/

Install cudnn:

conda install cudnn=7.0.5 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/

PIP replaces domestic installation source

Some domestic mirrors of pip

  Alibaba Cloud http://mirrors.aliyun.com/pypi/simple/University of
  Science and Technology of China https://pypi.mirrors.ustc.edu.cn/simple/douban(douban
) http://pypi.douban.com/simple /
  Tsinghua University https://pypi.tuna.tsinghua.edu.cn/simple/University of
  Science and Technology of China http://pypi.mirrors.ustc.edu.cn/simple/

Modify the source method:

Temporary use:
You can add the -i parameter after using pip to specify the pip source
eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple

Permanent modification:
linux:
modify ~/.pip/pip.conf (create one if not), the content is as follows:

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

Guess you like

Origin blog.csdn.net/MrCharles/article/details/108290850