Python Pyinstaller exe在某些电脑上不工作(LookupError:未知编码:cp65001)

Python Pyinstaller exe在某些电脑上不工作(LookupError:未知编码:cp65001),python,python-2.7,encoding,pyinstaller,Python,Python 2.7,Encoding,Pyinstaller,使用Pyinstaller(3.5.dev0+0ffa574bf)编译的可执行文件在某些PC上执行时崩溃(在其他PC上工作)。Windows10Pro Traceback (most recent call last): File "*******.py", line 1, in <module> File "c:\users\sashako\appdata\local\temp\pip-install-tzzt7n\PyInstaller\PyInstaller\loader\

使用Pyinstaller(3.5.dev0+0ffa574bf)编译的可执行文件在某些PC上执行时崩溃(在其他PC上工作)。Windows10Pro

Traceback (most recent call last):
File "*******.py", line 1, in <module>
  File "c:\users\sashako\appdata\local\temp\pip-install-tzzt7n\PyInstaller\PyInstaller\loader\pyimod03_importers.py", line 395, in load_module
  File "site-packages\pylab.py", line 1, in <module>
  File "c:\users\sashako\appdata\local\temp\pip-install-tzzt7n\PyInstaller\PyInstaller\loader\pyimod03_importers.py", line 395, in load_module
  File "site-packages\matplotlib\__init__.py", line 1131, in <module>
  File "site-packages\matplotlib\__init__.py", line 975, in rc_params
  File "site-packages\matplotlib\__init__.py", line 1100, in rc_params_from_file
  File "site-packages\matplotlib\__init__.py", line 1018, in _rc_params_in_file
  File "contextlib.py", line 17, in __enter__
  File "site-packages\matplotlib\__init__.py", line 1003, in _open_file_or_url
LookupError: unknown encoding: cp65001
[6292] Failed to execute script *******
回溯(最近一次呼叫最后一次):
文件“******.py”,第1行,在
文件“c:\users\sashako\appdata\local\temp\pip-install-tzt7n\PyInstaller\PyInstaller\loader\pyimod03\u importers.py”,第395行,在加载模块中
文件“site packages\pylab.py”,第1行,在
文件“c:\users\sashako\appdata\local\temp\pip-install-tzt7n\PyInstaller\PyInstaller\loader\pyimod03\u importers.py”,第395行,在加载模块中
文件“site packages\matplotlib\\uuuu init\uuuu.py”,第1131行,在
文件“site packages\matplotlib\\ uuuu init\ uuuuu.py”,第975行,在rc_参数中
文件“site packages\matplotlib\\ uuuuu init\ uuuuuu.py”,第1100行,位于\u文件的rc\u参数中
文件“site packages\matplotlib\\ uuuu init\ uuu.py”,第1018行,在\u rc\u params\u in_文件中
文件“contextlib.py”,第17行,输入__
文件“site packages\matplotlib\\ uuuuu init\uuuuuu.py”,第1003行,在\u open\u File\u或\u url中
LookupError:未知编码:cp65001
[6292]无法执行脚本*******

在使用chcp 65001执行脚本之前,尝试在同一cmd窗口(和power shell)中转换为cp65001。还尝试了其他编码。

降级Pyinstaller为我解决了这个问题
pip install pyinstaller==3.1

3.1没有解决问题,4.0也没有。然而,3.6起了作用