【Python】pip的镜像安装异常解决方案

在安装pip的出现异常提示:

ERROR: Could not find a version that satisfies the requirement pillow ( from  versions: none) 
ERROR: No matching distribution found
for pillow

错误说了,找不到这个pillow,所以出现安装异常。

如何安装pip?

a、电脑系统:windows

b、永久修改使用安装方法

c、准备镜像地址,如下:

 清华大学: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/
华中科技大学:http://pypi.hustunique.com/
百度: https://simple.baidu.com/pypi/simple

步骤开始:

1、在系统C盘根目录的用户(users)文件夹找到当前的正在使用电脑的用户:【C盘\用户\当前用户】

2、新建文件夹pip,新建txt文本【注意点查看,勾选文件扩展名】,把txt文本改为:pip.ini

 

3、双击打开这个文件,复制下面代码,粘贴进入文档,CTRL+S保存。

[ global  ]
index_url
=【上面的镜像地址:如】http://mirrors.aliyun.com/pypi/simple/
[install]
trusted
-host=【上面的镜像地址第一个/以前的字母:如】mirrors.aliyun.com

4、WIN+R打开电脑运行窗口,输入CMD,打开命令窗口,在命令窗口输入以下代码:

pip install pillow

5、回车,显示如下信息,其中有Successfully,表示安装成功。

Looking  in  indexes: http: //  mirrors.aliyun.com/pypi/simple/ 
 Collecting pillow
Downloading http:
// mirrors.aliyun.com/pypi/packages/18/c5/fbbcab5cc53c4278c1843d985c6e8e80c79f993c6c1e07f587f34afc76ee/Pillow-9.4.0-cp37-cp37m-win_amd64.whl (2.5 MB) |████████████████████████████████| 2.5 MB 437 kB/ s
Installing collected packages: pillow
Successfully installed pillow
- 9.4 . 0 WARNING: You are using pip version 20.1 . 1 ; however, version 22.3 . 1 is available.
You should consider upgrading via the
' e:\python\python.exe -m pip install --upgrade pip ' command.

 

现在我说说我出项的异常是为啥:就是缺少了,如下代码:

 [install] 
trusted
-host=【上面的镜像地址第一个/以前的字母:如】mirrors.aliyun.com

大概应该就是表示,缺少具体的对象,无法找到具体的指向去下载安装相应的信息。

 

标签: python

添加新评论