G
G
Guerro692021-07-16 21:05:50
Building projects
Guerro69, 2021-07-16 21:05:50

Compilation problem with Pyinstaller?

I made a program in PySide2 and now it needs to be compiled into an .exe and sent to friends, but when compiling the file using PyInstaller, a strange error occurs with the "re" and "enum" module.

187 INFO: PyInstaller: 5.0.dev0
187 INFO: Python: 3.8.5
187 INFO: Platform: Windows-10-10.0.19041-SP0
187 INFO: wrote C:\Users\asus1\Desktop\python\impulse.spec
203 INFO: UPX is not available.
218 INFO: Extending PYTHONPATH with paths
['C:\\Users\\asus1\\Desktop\\python',
 'C:\\Users\\asus1\\Desktop\\python']
pygame 2.0.0 (SDL 2.0.12, python 3.8.5)
Hello from the pygame community. https://www.pygame.org/contribute.html
327 INFO: checking Analysis
327 INFO: Building Analysis because Analysis-00.toc is non existent
327 INFO: Initializing module dependency graph...
327 INFO: Caching module graph hooks...
359 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\traceback.py", line 5, in <module>
    import linecache
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\linecache.py", line 11, in <module>
    import tokenize
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\tokenize.py", line 32, in <module>
    import re
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\re.py", line 145, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\traceback.py", line 5, in <module>
    import linecache
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\linecache.py", line 11, in <module>
    import tokenize
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\tokenize.py", line 32, in <module>
    import re
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\re.py", line 145, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
7778 INFO: Processing pre-find module path hook distutils from 'c:\\users\\asus1\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
7778 INFO: distutils: retargeting to non-venv dir 'c:\\users\\asus1\\appdata\\local\\programs\\python\\python38-32\\lib'
12683 INFO: Caching module dependency graph...
13027 INFO: running Analysis Analysis-00.toc
13089 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\asus1\appdata\local\programs\python\python38-32\python.exe
13417 INFO: Analyzing C:\Users\asus1\Desktop\python\Bombers\impulse.py
15057 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'c:\\users\\asus1\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\site-packages\urllib3\__init__.py", line 7, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\site-packages\urllib3\connectionpool.py", line 3, in <module>
    import logging
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\logging\__init__.py", line 26, in <module>
    import sys, os, time, io, re, traceback, warnings, weakref, collections.abc
  File "c:\users\asus1\appdata\local\programs\python\python38-32\lib\re.py", line 145, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
pre-safe-import-module hook failed, needs fixing.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2021-07-17
@Guerro69

pip uninstall -y enum34
And repeat the assembly.

A
Alan Gibizov, 2021-07-17
@phaggi

No, not a compilation issue with Pyinstaller.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question