`
wwt_cxy001
  • 浏览: 8462 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

大话 Python:python 基础巩固 -- pip 配置国内镜像站

阅读更多

有很多小伙伴反映 python 的安装总是要到国外网站,每次安装 python 库都要等很长的时间,其实有很多优秀的企业或者是大学都会配备一些资源的镜像并且都是为大家开源的。镜像站就是在资源更新以后,将下载速度非常慢的资源下载到自己的服务器上供大家在后续的使用中方便下载,今天主要看一下 python 库的镜像站有哪些以及如何使用。
1、python 库的国内镜像站

  • https://pypi.tuna.tsinghua.edu.cn/simple

  • http://mirrors.aliyun.com/pypi/simple/

  • https://pypi.mirrors.ustc.edu.cn/simple/

  • http://pypi.hustunique.com/

  • http://pypi.sdutlinux.org/ 

  • http://pypi.douban.com/simple/

 

2、临时使用镜像源安装 python 库

 

使用 pip install -i 的命令安装 pyspider 库(使用阿里云镜像源)

 

1pip install -i http://mirrors.aliyun.com/pypi/simple/ pyspider

 

3、永久使用镜像源安装 python 库

 

  • Linux 操作系统

cd ~,切换到用户的当前目前下,修改文件 ~/.pip/pip.conf (文件不存在时可以新建一个)。

 

1[global]
2index-url = https://pypi.tuna.tsinghua.edu.cn/simple
3[install]
4trusted-host=mirrors.aliyun.com

 

  • Windows 操作系统

同样,创建一个文件 C:\Users\xx\pip\pip.ini,在文件中添加和 Linux 系统一样的文件内容。

 

更多精彩前往微信公众号,领取视频教程,专注python编程实战,原创文章每天更新!

 

在这里插入图片描述

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics