Python 环境设置 修改pip镜像源 临时使用镜像源 pip install -i https://mirrors.aliyun.com/simple some-package --trusted-host mirrors.aliyun.com 默认使用镜像源 Pip的配置文件为用户根目录下的: ~/.pip/pip.conf (Windows路径为: $HOME\pip\pip.ini ),可以通过手动创建或者修改该文件 [global] index-url = https://mirrors.aliyun.com/pypi/simple trusted-host = mirrors.aliyun.com timeout = 120 命令行方式修改 pip config set global.index-url https://mirrors.aliyun.com/pypi/simple 参考资料: 【清华大学开源软件镜像站】 - PyPI 镜像使用帮助 【知乎】 - pip 修改为国内镜像源(中科大镜像、阿里镜像、豆瓣镜像、清华镜像)