开发环境为PyCharm,直接在PyCharm中点击安装pyinstaller很方便,很快就安装成功。

Dos安装pyinstaller时报错Non-UTF-8 code starting with '\x90' in file pip3.6.exe on line 1

但想在dos中尝试安装一下。预期很简单,输入一条命令即可:pip install pyinstaller。

但实际输入后,pip报错!

如下图所示,cmd中先进入项目的虚拟环境中python.exe和pip.exe所在的路径,然后直接输入pip install pyinstaller,命令无效

在pycharm中进行一些命令,如把*.ui文件转为py文件时,发现命令第一个需要先指定python.exe文件,于是把命令改为python.exe pip3.6.exe install pyinstaller,发现命令有效了,只是报错:pip3.6.exe第一行非utf-8编码类的提示。打开提示的网站,是说要我们添加python编码声明。

Dos安装pyinstaller时报错Non-UTF-8 code starting with '\x90' in file pip3.6.exe on line 1

pip3.6.exe改不了了,改其py文件pip3.6-script.py,在第二行加一句# -*- coding: utf-8 -*-,注意,需要紧跟第一行的编译器声明,编码声明必须在文件的第一行或第二行。

Dos安装pyinstaller时报错Non-UTF-8 code starting with '\x90' in file pip3.6.exe on line 1

保存文件后,输入命令python.exe pip3.6-script.py install pyinstaller,最后提示安装成功。

Dos安装pyinstaller时报错Non-UTF-8 code starting with '\x90' in file pip3.6.exe on line 1

在虚拟环境的Scripts下,有pip、pip3、pip3.6,这3个用哪个都可以。

相关文章:

  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2021-09-15
猜你喜欢
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2021-05-09
  • 2021-09-11
  • 2022-03-04
  • 2022-12-23
相关资源
相似解决方案