成都创新互联网站制作重庆分公司

pip使用国内镜像源的方法

pip 是一个安装和管理 Python 包的工具,Python pip默认安装模块路径是国外的服务器,本次我们将国外的服务器替换成国内的镜像服务器,来更好的安装Python的各种模块。

成都创新互联制作网站网页找三站合一网站制作公司,专注于网页设计,做网站、网站建设,网站设计,企业网站搭建,网站开发,建网站业务,680元做网站,已为超过千家服务,成都创新互联网站建设将一如既往的为我们的客户提供最优质的网站建设、网络营销推广服务!

常用国内镜像:
(1)阿里云 http://mirrors.aliyun.com/pypi/simple/
(2)豆瓣http://pypi.douban.com/simple/
(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
(5)华中科技大学http://pypi.hustunique.com/
方法一:临时使用
加参数-i和镜像地址
例如:
pip install -i  https://pypi.tuna.tsinghua.edu.cn/simple scrapy
方法二:永久修改
linux:
修改:pip.conf没有创建一个文件夹及文件。文件夹要加".",表示是隐藏文件夹
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
windows:
直接在用户目录中创建一个pip目录,如:c:\user\xx\pip,然后新建文件pip.ini,内容:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn


新闻标题:pip使用国内镜像源的方法
新闻来源:http://cxhlcq.com/article/jgepgh.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部