mirror of
https://github.com/brentvollebregt/auto-py-to-exe.git
synced 2026-04-26 04:05:49 +03:00
[GH-ISSUE #46] Failed to execute script pyi_rth_win32comgenpy #44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nauticalcoder on GitHub (Feb 6, 2019).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/46
After creating an exe from my Python script, I am getting the following error when attempting to run the .exe.
Traceback (most recent call last): File "site-packages\PyInstaller\loader\rthooks\pyi_rth_win32comgenpy.py", line 47, in <module> File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 395, in load_module exec(bytecode, module.__dict__) File "site-packages\win32com\__init__.py", line 5, in <module> ImportError: No module named win32api [27000] Failed to execute script pyi_rth_win32comgenpyPywin32 was installed from the binary installed (after previously installing it from pip). I haven't found a workaround for this. The exe's were previously running but it kept throwing an error about a missing win32com module in the console window when auto-py-to-exe ran so I installed pywin32. Now I am getting the above error. Reverting the pywin32 installed does not have any effect.
Python 2.7
@brentvollebregt commented on GitHub (Feb 6, 2019):
Is this working before it is packaged? If so, then try adding
win32apito the --hidden-import input field in the advanced tab@nauticalcoder commented on GitHub (Mar 22, 2019):
I am not sure exactly what was going on with this but it is building now. I am not using any --hidden-import's. I did uninstall everything pywin32 related. The only pip installed that appears to be win32 related is
pywin32-ctypes. I wish I had a better explanation for what fixed it.@brentvollebregt commented on GitHub (Mar 22, 2019):
win32api is part of the pywin32 package so it must have been getting added. This is handled by PyInstaller; unfortunately I cannot explain why it would have been added if you didn't use it.
@bharathronanki commented on GitHub (Jan 6, 2020):
I had the same problem in my exe file when converter from python code. But i didn't understand your answer '--hidden-import input field in the advance tab'. Can you please elaborate and help me solving my error.
@brentvollebregt commented on GitHub (Jan 6, 2020):
The UI has an
Advancedheader. If you click on that, it will expand the body. There is an input by--hidden-importwhere you can put the import.Please open a new issue if you are reporting an issue.
@gabemorris12 commented on GitHub (Jan 6, 2021):
I had this same issue, but uninstalling and reinstalling didn't fix it for me. To fix this, I added the
--hidden-import "pywin32"flag and it worked!@davidsam25 commented on GitHub (Apr 27, 2022):
I had the same issue, I've tried:
Still not working! I don't know what to do! Any idea please?
Error :
ModuleNotFoundError: No module named 'win32api'
[49272] Failed to execute script 'pyi_rth_win32comgenpy' due to unhandled exception!
@brentvollebregt commented on GitHub (Apr 29, 2022):
@davidsandbar are you sure the python installation / venv you are using to run auto-py-to-exe is the same installation / venv you have pywin32 etc installed in?
@davidsam25 commented on GitHub (Apr 29, 2022):
Many thanks for your help - at the end, what make it works was to open conda shell in admin mode, and run auto-py-to-exe from this window - and it worked