ERROR: Could not find a version that satisfies the requirement six>=1.9.0

问题分析

ERROR: Could not find a version that satisfies the requirement six>=1.9.0 (from prompt-toolkit) (from versions: none) ERROR: No matching distribution found for six>=1.9.0

出现这个问题的原因是python国内网络不稳定,用pip管理工具安装库文件时,默认使用国外的源文件,在国内的下载速度会比较慢容易直接报错。因此我们常采用更换镜像源的方式来解决此问题。

请添加图片描述

解决方案:

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

除了清华镜像源还有下列镜像源使用起来比较方便

(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/

使用镜像源

使用镜像源有两种方式:

  • 一种是像上面bash命令一样。
  • 另一种是进行本地配置(进行本地配置之后就可以实现随时随地使用镜像源了)。

在windows与linux系统中持久化配置镜像源方法如下:

(a)Linux下,修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)
配置内容如下:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

(b) windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,然后新建文件pip.ini,即 %HOMEPATH%\pip\pip.ini,在pip.ini文件中输入以下内容:

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com

pycharm配置镜像源

第一步打开设置
请添加图片描述
第二、三步
请添加图片描述
第四步
请添加图片描述
第五步点击+,并将镜像url粘贴到输入框内。
请添加图片描述
大工告成!

猜你喜欢

转载自blog.csdn.net/apple_51931783/article/details/128423105