When i try to create the executable for my program using pyinstaller --onefile gui.py
it gives me this error. pyqt5 and all the required packages are installed for the program but when i tried to create the executable it gives me this error what is wrong with the process
JavaScript
x
60
60
1
Traceback (most recent call last):
2
File "<string>", line 1, in <module>
3
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagessqlalchemy__init__.py", line 8, in <module>
4
from . import util as _util
5
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagessqlalchemyutil__init__.py", line 103, in <module>
6
from .concurrency import asyncio
7
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagessqlalchemyutilconcurrency.py", line 20, in <module>
8
from ._concurrency_py3k import await_only
9
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagessqlalchemyutil_concurrency_py3k.py", line 8, in <module>
10
import asyncio
11
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesasyncio__init__.py", line 21, in <module>
12
from .base_events import *
13
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesasynciobase_events.py", line 296
14
future = tasks.async(future, loop=self)
15
^^^^^
16
SyntaxError: invalid syntax
17
Traceback (most recent call last):
18
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310librunpy.py", line 196, in _run_module_as_main
19
return _run_code(code, main_globals, None,
20
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310librunpy.py", line 86, in _run_code
21
exec(code, run_globals)
22
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310Scriptspyinstaller.exe__main__.py", line 7, in <module>
23
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstaller__main__.py", line 178, in run
24
run_build(pyi_config, spec_file, **vars(args))
25
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstaller__main__.py", line 59, in run_build
26
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
27
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerbuildingbuild_main.py", line 845, in main
28
build(specfile, distpath, workpath, clean_build)
29
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerbuildingbuild_main.py", line 767, in build
30
exec(code, spec_namespace)
31
File "E:ImalkaVarCheckgui.spec", line 7, in <module>
32
a = Analysis(
33
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerbuildingbuild_main.py", line 319, in __init__
34
self.__postinit__()
35
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerbuildingdatastruct.py", line 173, in __postinit__
36
self.assemble()
37
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerbuildingbuild_main.py", line 487, in assemble
38
self.graph.process_post_graph_hooks(self)
39
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerdependanalysis.py", line 326, in process_post_graph_hooks
40
module_hook.post_graph(analysis)
41
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerdependimphook.py", line 398, in post_graph
42
self._load_hook_module()
43
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerdependimphook.py", line 361, in _load_hook_module
44
self._hook_module = importlib_load_source(self.hook_module_name, self.hook_filename)
45
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallercompat.py", line 620, in importlib_load_source
46
return mod_loader.load_module()
47
File "<frozen importlib._bootstrap_external>", line 548, in _check_name_wrapper
48
File "<frozen importlib._bootstrap_external>", line 1063, in load_module
49
File "<frozen importlib._bootstrap_external>", line 888, in load_module
50
File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
51
File "<frozen importlib._bootstrap>", line 719, in _load
52
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
53
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
54
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
55
File "C:Usersoshada.iAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerhookshook-sqlalchemy.py", line 31, in <module>
56
dialects = eval(dialects.strip())
57
File "<string>", line 0
58
59
SyntaxError: invalid syntax
60
Advertisement
Answer
Finally i found a solution to fix the error. it because of the asyncio package remove the package using pip uninstall asyncio
and run the pyinstaller it will compile the .exe file