pip install pyinstaller安装报错

在学习python时,需要用到pyinstal库,将.py文件转化为.exe可执行文件。在windows下cmd命名行中,使用pip install pyinstaller安装,但是在安装时遇到报错:

报错信息

然后在按照它给的命名:c:\users\28032\appdata\local\programs\python\python38\python.exe -m pip install --upgrade pip输入,同样报相同的错。然后重新查看信息,发现前面还有一个warming:

在这里插入图片描述

首先解决第一个警告,连接失败,安装不上。解决办法换镜像。

阿里云 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 pyinstaller -i http://pypi.douban.com/simple 发现还是报错:
WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with ‘–trusted-host pypi.douban.com’

报错主机不被信任,正在被忽略。查阅百度后,需要再加上命令,允许主机这条警告:pip install pyinstaller -i http://pypi.douban.com/simple --trusted-host pypi.douban.com 。后面的安装基本可以忽略pip版本的警告了。

在这里插入图片描述

看到Successfully built pyinstaller,表示pyinstaller已经安装完成了,可以开始使用了。