Z
Z
Zubaaaa2020-08-06 21:44:51
Python
Zubaaaa, 2020-08-06 21:44:51

How to solve error when converting from py to exe (python)?

88 INFO: PyInstaller: 3.5
88 INFO: Python: 3.8.5
89 INFO: Platform: Windows-10-10.0.18362-SP0
91 INFO: wrote C:\Users\Danil\Desktop\auto\auto.spec
93 INFO: UPX is not available.
95 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Danil\\Desktop\\auto', 'C:\\Users\\Danil\\Desktop\\auto']
95 INFO: checking Analysis
95 INFO: Building Analysis because Analysis-00.toc is non existent
96 INFO: Initializing module dependency graph...
98 INFO: Initializing module graph hooks...
102 INFO: Analyzing base_library.zip ...
4277 INFO: Processing pre-find module path hook   distutils
8759 INFO: running Analysis Analysis-00.toc
8761 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\danil\appdata\local\programs\python\python38-32\python.exe
11233 INFO: Caching module hooks...
11249 INFO: Analyzing C:\Users\Danil\Desktop\auto\auto.py
12857 INFO: Loading module hooks...
12858 INFO: Loading module hook "hook-distutils.py"...
12860 INFO: Loading module hook "hook-encodings.py"...
13000 INFO: Loading module hook "hook-lib2to3.py"...
13005 INFO: Loading module hook "hook-PIL.Image.py"...
13504 INFO: Loading module hook "hook-PIL.py"...
13506 INFO: Import to be excluded not found: 'PySide'
13506 INFO: Excluding import 'PyQt4'
13509 INFO: Import to be excluded not found: 'FixTk'
13509 INFO: Excluding import 'PyQt5'
13512 INFO:   Removing import of PyQt5.QtCore from module PIL.ImageQt
13512 INFO:   Removing import of PyQt5.QtGui from module PIL.ImageQt
13514 INFO: Excluding import 'tkinter'
13518 INFO:   Removing import of tkinter from module PIL.ImageTk
13519 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
13521 INFO: Import to be excluded not found: 'FixTk'
13521 INFO: Excluding import 'tkinter'
13522 INFO: Loading module hook "hook-pydoc.py"...
13523 INFO: Loading module hook "hook-PyQt5.py"...
13702 WARNING: Hidden import "sip" not found!
13702 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
15346 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
17109 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
21268 INFO: Loading module hook "hook-PySide2.py"...
21656 INFO: Loading module hook "hook-PySide2.QtCore.py"...
23311 INFO: Loading module hook "hook-PySide2.QtGui.py"...
25932 INFO: Loading module hook "hook-PySide2.QtNetwork.py"...
28536 INFO: Loading module hook "hook-sysconfig.py"...
28537 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
28538 INFO: Loading module hook "hook-xml.py"...
28632 INFO: Loading module hook "hook-_tkinter.py"...
29341 INFO: checking Tree
29341 INFO: Building Tree because Tree-00.toc is non existent
29343 INFO: Building Tree Tree-00.toc
29539 INFO: checking Tree
29540 INFO: Building Tree because Tree-01.toc is non existent
29542 INFO: Building Tree Tree-01.toc
29665 INFO: Looking for ctypes DLLs
29840 INFO: Analyzing run-time hooks ...
29847 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
29857 INFO: Including run-time hook 'pyi_rth__tkinter.py'
29861 INFO: Including run-time hook 'pyi_rth_pyside2.py'
29863 INFO: Including run-time hook 'pyi_rth_pyqt5.py'
29877 INFO: Looking for dynamic libraries
58206 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\danil\appdata\local\programs\python\python38-32\lib\site-packages\PySide2\QtCore.pyd
58489 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\danil\appdata\local\programs\python\python38-32\lib\site-packages\PySide2\QtNetwork.pyd
58999 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\danil\appdata\local\programs\python\python38-32\lib\site-packages\PySide2\QtGui.pyd
75679 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\danil\appdata\local\programs\python\python38-32\lib\site-packages\PySide2\pyside2.abi3.dll
76858 INFO: Looking for eggs
76858 INFO: Using Python library c:\users\danil\appdata\local\programs\python\python38-32\python38.dll
76875 INFO: Found binding redirects:
[]
76885 INFO: Warnings written to C:\Users\Danil\Desktop\auto\build\auto\warn-auto.txt
77019 INFO: Graph cross-reference written to C:\Users\Danil\Desktop\auto\build\auto\xref-auto.html
77105 INFO: checking PYZ
77106 INFO: Building PYZ because PYZ-00.toc is non existent
77107 INFO: Building PYZ (ZlibArchive) C:\Users\Danil\Desktop\auto\build\auto\PYZ-00.pyz
Traceback (most recent call last):
  File "c:\users\danil\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\danil\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Danil\AppData\Local\Programs\Python\Python38-32\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
  File "c:\users\danil\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\danil\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\danil\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\danil\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\Danil\Desktop\auto\auto.spec", line 18, in <module>
    pyz = PYZ(a.pure, a.zipped_data,
  File "c:\users\danil\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 98, in __init__
    self.__postinit__()
  File "c:\users\danil\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "c:\users\danil\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 128, in assemble
    self.code_dict = {
  File "c:\users\danil\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\danil\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\danil\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\danil\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)

Ps It seems that I converted to UTF-8 encoding

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Ternick, 2020-08-07
@Ternick

Install the latest version of pyinstaller:

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

If you're lucky, it should work.
If you are satisfied with the answer, mark it as a solution.
It took me less than a minute and Google to find an approximate answer to your question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question