解决pip安装超时的问题

摘要:
[global]超时=60000索引url=https://pypi.tuna.tsinghua.edu.cn/simple[安装]使用镜像=真镜像=https://pypi.tuna.tsinghua.edu.cn这会将pip安装源更改为国内安装源。

使用pip安装python库的时候经常会遇到超时而无法下载的问题,解决办法如下:

一,首先在下面文件夹下建立一个pip文件夹

C:UsersAdministratorAppDataRoaming

然后在pip文件夹下新建一个文件pip.ini,内容:

[global]
timeout = 60000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
use-mirrors = true
mirrors = https://pypi.tuna.tsinghua.edu.cn

这样就把pip安装源改成国内的了,速度很快

二,可单次使用国内源

1,设置超时时间:pip --default-timeout=100 install  Pillow,

2,不使用缓存:pip  --no-cache-dir install Pillow

2,使用国内源:pip install web.py -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

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

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

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

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

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

例:使用如下方法解决 下载速度会明显改善 

  

pip install -i https://pypi.doubanio.com/simple/ pypiwin32

慢: python -m pip install pypiwin32


———————————————— 
原文链接:https://blog.csdn.net/qq_39161804/article/details/81191977

免责声明:文章转载自《解决pip安装超时的问题》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Kalendae——一款功能强大的日历插件3.Linux 文件的压缩与打包下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

pip安装离线包

离线包从pypi.org下载 pip download -r requirements.txt -d /tmp/paks/ 在linux下 1.下载指定的包到指定文件夹。 pip list #查看安装的包 pip freeze > requirements.txt 将已经通过pip安装的包的名称记录到requirements.txt文件中 创建存...

各大巨头电商提供的IP库API接口新浪、搜狐、阿里

新浪的IP地址查询接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js     (不可用)新浪多地域测试方法:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=218.192.3.42     (...

pycharm安装插件的方法

1.通过命令行安装 1)通过命令行安装:win + R --> cmd --> pip install  ***   2)pycharm  -->Terminal -->pip install *** 2.通过页面安装 File-->Settings Project:***--> Project Interprete...

selenium3+python自动化50-环境搭建(firefox)【转载】

前言 有不少小伙伴在安装selenium环境后启动firefox报错,因为现在selenium升级到3.0了,跟2.0的版本还有有一点区别的。 安装环境过程中主要会遇到三个坑: 1.'geckodriver' executable needs to be in PATH 2.Expected browser binary location, but una...

windows 安装使用jupyter及 基础配置

jupyter 是什么Jupyter Notebooks 是一个交互式笔记本,支持运行 40 多种编程语言,它的本质是一个 开源的 Web 应用程序,我们可以将其用于创建和共享代码与文档,他可以支持实时代码,数学方程,可视化和 markdown。Jupyter Notebooks提供了一个环境,让你可以无需离开这个环境,就可以在其中编写你的代码、运行代码、...

Mac anaconda 在terminal中fbprophet安装过程

首先要安装好conda install pystan 再安装pip install fbprohet 调试的时候报错一:cannot import name 'easter' from 'holidays' holiday版本过高(将版本下载) pip install holidays==0.9.8 依旧解决不了问题,于是整体升级版本 pip instal...