Renan Klehm
Renan Klehm

Reputation: 168

Pyinstaller generating empty dist folder

I'm relatively new to python and I'm trying to create an EXE of a Python Application.

I saw that there is a lot of similar question here on Stack Overflow, but none has significative answers, so I decided to bring this again.

Here is the verbose of the 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)

It generates both build and dist folders, but the dist folder where the .exe what supposed to be is empty.

Upvotes: 0

Views: 691

Answers (1)

Renan Klehm
Renan Klehm

Reputation: 168

Thanks, @John T

I downgraded to 3.7.6 and now Pyinstaller is building the .exe as expected, a few errors show up when I run the .exe, but it's working!

Thanks again.

Upvotes: 1

Related Questions