Python pip 使用镜像源
Python 拉取官方依赖实在太慢了, 使用国内镜像源加加速
我选择使用阿里源, 相对稳定可靠
临时使用
pip install package_name -i https://mirrors.aliyun.com/pypi/simple
永久设置阿里源
通过 pip 命令配置
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
手动配置文件
- Linux/macOS 路径:
~/.pip/pip.conf
- Windows 路径:
%HOMEPATH%\pip\pip.ini
[global]
index-url = https://mirrors.aliyun.com/pypi/simple