镜像源
- 官方:
https://pypi.python.org/pypi
- 豆瓣:
https://pypi.doubanio.com/simple/
- 阿里:
http://mirrors.aliyun.com/pypi/simple/
- 中科大:
https://mirrors.ustc.edu.cn/pypi/web/simple/
- 清华:
https://pypi.tuna.tsinghua.edu.cn/simple/
- 其他镜像站:前往>>
使用方法
方案一、仅本次使用国内镜像源
pip install pythonModuleName -i https://pypi.douban.com/simple
方案二、配置成默认的镜像源
- Windows下,创建并修改
C:\Users\%USERNAME%\pip\pip.ini
(以UTF-8 无BOM格式编码) - Linux下,创建并修改
~/.config/pip/pip.conf
[global]
index-url=http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
[ Attention ]:trusted-host
非必须,使用时提示不受信任可添加--trusted-host=mirrors.aliyun.com
补充:对于conda 修改C:\Users\%USERNAME%\.condarc
文件
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
show_channel_urls: true