修改Python pip镜像源

PyPI(Python Package Index)是默认的包管理仓库,但由于地理位置或网络问题,在某些地区访问 PyPI 可能会很慢。通过设置镜像源可以显著提高安装 Python 包的速度。

清华镜像源

# 配置镜像源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 设置受信的镜像站,避免因证书问题在安装包时出现警告或错误
pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn

阿里镜像源

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple 
pip config set install.trusted-host mirrors.aliyun.com

你可能感兴趣的:(Python,python,pip,linux)