python pip domestic source configuration

Domestic pip source

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

Temporarily specify pip source

#pip install 包名 –i pip源
pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple/ 

Permanently configure domestic pip source


linux

Create ~/.pip/pip.conf file

#创建
mkdir ~/.pip
vim ~/.pip/pip.conf

Add the following content:

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

Window

Enter the user directory and create a pip file

%HOMEPATH%

Insert picture description here

Enter the pip directory, create a pip.ini file, and add the following content:

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

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_41924764/article/details/109575667