pip switch to domestic source
Domestic source
Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple
Aliyun: https://mirrors.aliyun.com/pypi/simple
University of Science and Technology of China: https://pypi.mirrors.ustc.edu.cn/simple
Douban: https://pypi.douban.com/simple
Temporary use
Add parameters when using pip -i https://pypi.tuna.tsinghua.edu.cn/simple
For instance: pip install -i http://mirrors.aliyun.com/pypi/simple/ tensorflow
Permanent use
Configuration file
modify ~/.pip/pip.conf
The content is as follows:
1 |
|
Create a pip directory in the users directory, then new file pip.ini
For instance: C:\Users\12439\pip\pip.ini
Content same as above
Check the configuration
Enter the following command in cmd
1 |
|
pip switch to domestic source
https://www.hardyhu.cn/2022/01/09/pip-switch-to-domestic-source/