Python在pip时常用的镜像源

python 常用的镜像源

  • 国内镜像
  • 国外镜像
  • 使用方法
    • 临时使用
    • 默认使用

Python在cmd中下库时用pip install xxxx(xxxx为库名),默认在Python的官方源pypi.python.org/pypi 下载,有时会因为超时等问题无法下载成功。所以可以选择一些比较稳定速度比较快的国内镜像来下载python库。

国内镜像

豆瓣:
http://pypi.douban.com/simple 

阿里
http://mirrors.aliyun.com/pypi/simple

清华
https://pypi.tuna.tsinghua.edu.cn/simple

华中理工大学
http://pypi.hustunique.com/simple

山东理工大学
http://pypi.sdutlinux.org/simple

中国科学技术大学
http://pypi.mirrors.ustc.edu.cn/simple 

国外镜像

加利福尼亚大学

https://www.lfd.uci.edu/~gohlke/pythonlibs/

使用方法

临时使用

#安装库
pip install -i + 镜像源 + 库名

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple selenium

#升级pip
python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

默认使用

pip config set global.index-url + 镜像源

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

配置上面后,以后使用直接 pip install xxxxx(xxxxx为库名) 默认是从配置的镜像源中安装。

Python在pip时常用的镜像源_第1张图片

你可能感兴趣的:(Python)