Python 3.x 我试图使用pyinstaller将单个python.py转换为windows可执行文件.exe,但它总是崩溃

Python 3.x 我试图使用pyinstaller将单个python.py转换为windows可执行文件.exe,但它总是崩溃,python-3.x,windows,pyinstaller,Python 3.x,Windows,Pyinstaller,C:\Users\pheelz\Desktop>pyinstaller-w test.py 这是我得到的错误 500信息:PyInstaller:3.4 501信息:Python:3.8.0 502信息:平台:Windows-10-10.0.10240-SP0 512信息:编写了C:\Users\pheelz\Desktop\test.spec 538信息:UPX不可用。 568信息:使用路径扩展PYTHONPATH ['C:\Users\pheelz\Desktop','C:\Users\ph

C:\Users\pheelz\Desktop>pyinstaller-w test.py

这是我得到的错误

500信息:PyInstaller:3.4 501信息:Python:3.8.0 502信息:平台:Windows-10-10.0.10240-SP0 512信息:编写了C:\Users\pheelz\Desktop\test.spec 538信息:UPX不可用。 568信息:使用路径扩展PYTHONPATH ['C:\Users\pheelz\Desktop','C:\Users\pheelz\Desktop'] 569信息:检查分析 1167信息:正在检查PYZ 1168信息:正在生成PYZ,因为PYZ-00.toc不存在 1169信息:构建PYZ(ZlibArchive)C:\Users\pheelz\Desktop\build\test\PYZ-00.PYZ 回溯(最近一次呼叫最后一次): 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\runpy.py”,第192行,在运行模块中作为主 返回运行代码(代码、主全局、无、, 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\runpy.py”,第85行,在运行代码中 exec(代码、运行\全局) 文件“C:\Users\pheelz\AppData\Local\Programs\Python38-32\Scripts\pyinstaller.exe\uuuuuu main\uuuuuuuuuu.py”,第7行,在 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\site packages\PyInstaller\uuuuuuuuu main\uuuuuuuuuuuuuu.py”,第111行,正在运行 运行构建(pyi\u配置,规范文件,**vars(args)) 文件“c:\users\pheelz\appdata\local\programs\python 38-32\lib\site packages\PyInstaller\uuuuuu main\uuuuuuuuu.py”,第63行,在run\u build中 PyInstaller.building.build\u main.main(pyi\u配置,spec\u文件,**kwargs) 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\site packages\PyInstaller\building\build\u main.py”,第838行,在main中 构建(specfile,kw.get('distpath'),kw.get('workpath'),kw.get('clean_build')) 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\site packages\PyInstaller\building\build\u main.py”,第784行,内部版本 exec(文本,规范名称空间) 文件“”,第18行,在 文件“c:\users\pheelz\appdata\local\programs\python38-32\lib\site packages\PyInstaller\building\api.py”,第98行,在init self.postinit() 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\site packages\PyInstaller\building\datastruct.py”,第158行,位于postinit self.assembly() 汇编文件“c:\users\pheelz\appdata\local\programs\python 38-32\lib\site packages\PyInstaller\building\api.py”第128行 self.code_dict={ 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\site packages\PyInstaller\building\api.py”,第129行,在 关键字:代码中的条带路径(代码) 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\site packages\PyInstaller\building\utils.py”,第654行,位于代码中的strip_paths 常量=元组( 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\site packages\PyInstaller\building\utils.py”,第655行,在 代码中的条带路径(常量,新文件名) 文件“c:\users\pheelz\appdata\local\programs\python\python38-32\lib\site packages\PyInstaller\building\utils.py”,第662行,位于代码中的条带路径中 返回代码_func(co.co_argcount、co.co_kwonlyargcount、co.co_nlocals、co.co_stacksize、,
TypeError:需要一个整数(获取类型字节)

据我所知,您正在使用Python3.8.0上的PyInstaller 3.4

PyInstaller仅在Python 2.7和3.4-3.7中工作,如上所述

也许您应该将您的环境降级到Python 3.7.5