question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to execute script pyi_rth_win32comgenpy

See original GitHub issue

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_win32comgenpy

Pywin32 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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
davidsandbarcommented, 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?

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

0reactions
brentvollebregtcommented, 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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Failed to execute script 'pyi_rth_win32comgenpy' due ...
I just solved this for my project, which is using none of the direct imports your project is, but it appears the same...
Read more >
Failed to execute script pyi_rth_win32comgenpy - Anki Forums
I am on the latest update for windows 7, I have downloaded both these updates https://www.microsoft.com/en-us/download/details.aspx?id=48234 ...
Read more >
[Solved] Failed to execute script and some other errors
How to solve these three errors?1. Failed to execute script2. Maximum recursion depth exceeded while calling a python object3.
Read more >
How to convert Python file to .exe file | 3 ways to solve errors
Failed to execute script occur when you convert your python file into .exe file.Here are some steps you should follow to deal with...
Read more >
Python pyinstaller failed to execute script error solve. Add ...
Python pyinstaller failed to execute script error solve. Add image and py to exe - 2022. Python tkinter photo upload problem.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found