You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys,
I was creating an executable for kivy application. And it uses a python script that requires pywinauto. After building the exe using pyinistaller on the spec file, I was unable to access the exe. It is throwing an error with thread issue concerning comtypes of pywinauto.
I built this on Ananconda.
I got the following error down below.
Has anyone encountered the same? Please help , need to resolve this soon
Which hook/library isn't working?
Pyinstaller is unable to create exe for python file with pywinauto reference.
Does the error get raised while building or when running?
Error when running the exe
import pywinauto.application
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
File "pywinauto_init.py", line 87, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
File "pywinauto\sysinfo.py", line 44, in
File "", line 991, in _find_and_load
File "", line 975, in find_and_load_unlocked
File "", line 671, in load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
File "comtypes_init.py", line 160, in
File "comtypes_init.py", line 151, in CoInitializeEx
File "_ctypes/callproc.c", line 935, in GetResult
OSError: [WinError -2147417850] Cannot change thread mode after it is set
I want to run my kivy application as exe
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
OS: Windows
Python Version: 3.8.8
Version of pyinstaller-hooks-contrib: 2021.3
Version of PyInstaller - 4.6
The text was updated successfully, but these errors were encountered:
This looks like a variant of pyinstaller/pyinstaller#6198, which is caused by win32com being imported before the other package that tries to set the thread mode (which in this case seems to be comtypes).
In PyInstaller-frozen application, win32com is automatically imported via the pkg_resources and win32com runtime hooks, so the work-around is to modify those runtime hooks to import the other package before they import pkg_resources and win32com, as per pyinstaller/pyinstaller#6198 (comment).
Hi guys,
I was creating an executable for kivy application. And it uses a python script that requires pywinauto. After building the exe using pyinistaller on the spec file, I was unable to access the exe. It is throwing an error with thread issue concerning comtypes of pywinauto.
I built this on Ananconda.
I got the following error down below.
Has anyone encountered the same? Please help , need to resolve this soon
Pyinstaller is unable to create exe for python file with pywinauto reference.
Error when running the exe
import pywinauto.application
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
File "pywinauto_init.py", line 87, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
File "pywinauto\sysinfo.py", line 44, in
File "", line 991, in _find_and_load
File "", line 975, in find_and_load_unlocked
File "", line 671, in load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
File "comtypes_init.py", line 160, in
File "comtypes_init.py", line 151, in CoInitializeEx
File "_ctypes/callproc.c", line 935, in GetResult
OSError: [WinError -2147417850] Cannot change thread mode after it is set
I want to run my kivy application as exe
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
pyinstaller-hooks-contrib
: 2021.3The text was updated successfully, but these errors were encountered: