python默认使用国内源

方法1:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

方法2:

创建配置目录(如果不存在)

mkdir -p ~/.pip

编辑配置文件

cat > ~/.pip/pip.conf << EOF
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
EOF

posted @ 2026-05-13 13:33  slark_yuxj  阅读(19)  评论(0)    收藏  举报