Pyinstaller正在生成空的dist文件夹

2024-10-01 15:30:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我对python比较陌生,我正在尝试创建python应用程序的EXE

我看到这里有很多关于堆栈溢出的类似问题,但是没有一个有意义的答案,所以我决定再次提出这个问题

以下是Pyinstaller的详细信息:

C:\Users\renan.klehm\Desktop\AutoCTE-Python>pyinstaller --onefile cli.py
164 INFO: PyInstaller: 3.5
165 INFO: Python: 3.8.0
165 INFO: Platform: Windows-7-6.1.7601-SP1
181 INFO: wrote C:\Users\renan.klehm\Desktop\AutoCTE-Python\cli.spec
184 INFO: UPX is not available.
185 INFO: Extending PYTHONPATH with paths
['C:\\Users\\renan.klehm\\Desktop\\AutoCTE-Python',
 'C:\\Users\\renan.klehm\\Desktop\\AutoCTE-Python']
185 INFO: checking Analysis
476 INFO: checking PYZ
476 INFO: Building PYZ because PYZ-00.toc is non existent
476 INFO: Building PYZ (ZlibArchive) C:\Users\renan.klehm\Desktop\AutoCTE-Python
\build\cli\PYZ-00.pyz
Traceback (most recent call last):
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\runpy
.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\runpy
.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\renan.klehm\AppData\Local\Programs\Python\Python38-32\Scripts\p
yinstaller.exe\__main__.py", line 7, in <module>
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\building\build_main.py", line 844, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'
))
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\building\build_main.py", line 791, in build
    exec(code, spec_namespace)
  File "C:\Users\renan.klehm\Desktop\AutoCTE-Python\cli.spec", line 18, in <modu
le>
    pyz = PYZ(a.pure, a.zipped_data,
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\building\api.py", line 98, in __init__
    self.__postinit__()
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\building\api.py", line 128, in assemble
    self.code_dict = {
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\building\api.py", line 129, in <dictcomp>
    key: strip_paths_in_code(code)
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\building\utils.py", line 652, in strip_paths_in_code
    consts = tuple(
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\building\utils.py", line 653, in <genexpr>
    strip_paths_in_code(const_co, new_filename)
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-
packages\PyInstaller\building\utils.py", line 660, in strip_paths_in_code
    return code_func(co.co_argcount, co.co_kwonlyargcount, co.co_nlocals, co.co_
stacksize,
TypeError: an integer is required (got type bytes)

C:\Users\renan.klehm\Desktop\AutoCTE-Python>pyinstaller cli.py
131 INFO: PyInstaller: 3.5
131 INFO: Python: 3.8.0
131 INFO: Platform: Windows-7-6.1.7601-SP1
143 INFO: wrote C:\Users\renan.klehm\Desktop\AutoCTE-Python\cli.spec
144 INFO: UPX is not available.
147 INFO: Extending PYTHONPATH with paths
['C:\\Users\\renan.klehm\\Desktop\\AutoCTE-Python',
 'C:\\Users\\renan.klehm\\Desktop\\AutoCTE-Python']
147 INFO: checking Analysis
424 INFO: checking PYZ
424 INFO: Building PYZ because PYZ-00.toc is non existent
426 INFO: Building PYZ (ZlibArchive) C:\Users\renan.klehm\Desktop\AutoCTE-Python\build\cli\PYZ-00.pyz

Traceback (most recent call last):
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\renan.klehm\AppData\Local\Programs\Python\Python38-32\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\build_main.py", line 844, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'
))
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
    exec(code, spec_namespace)
  File "C:\Users\renan.klehm\Desktop\AutoCTE-Python\cli.spec", line 18, in <module>
    pyz = PYZ(a.pure, a.zipped_data,
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 98, in __init__
    self.__postinit__()
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 128, in assemble
    self.code_dict = {
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 129, in <dictcomp>
    key: strip_paths_in_code(code)
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\utils.py", line 652, in strip_paths_in_code
    consts = tuple(
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\utils.py", line 653, in <genexpr>
    strip_paths_in_code(const_co, new_filename)
  File "c:\users\renan.klehm\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\utils.py", line 660, in strip_paths_in_code
    return code_func(co.co_argcount, co.co_kwonlyargcount, co.co_nlocals, co.co_
stacksize,
TypeError: an integer is required (got type bytes)

它生成builddist文件夹,但是dist文件夹中的.exe应该是空的


Tags: inpyliblocallinesitecodeusers
1条回答
网友
1楼 · 发布于 2024-10-01 15:30:21

“谢谢,”约翰·T

我降级到了3.7.6,现在Pyinstaller正在按预期构建.exe,当我运行.exe时出现了一些错误,但它工作正常

再次感谢

相关问题 更多 >

    热门问题