[GH-ISSUE #151] ModuleNotFoundError: No module named 'pyautogui' on Python 3.8.6 #143

Closed
opened 2026-02-26 12:20:37 +03:00 by kerem · 6 comments
Owner

Originally created by @aquib-sh on GitHub (Jan 17, 2021).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/151

I tried creating exe multiple times, each time after running the output file it gave me ModuleNotFoundError: No module named 'pyautogui' . It runs perfectly with .py file and I do not have more than 1 version of Python installed. pyautogui is also installed but it seems that it doesn't compile while creating exe using autopytoexe.

Originally created by @aquib-sh on GitHub (Jan 17, 2021). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/151 I tried creating exe multiple times, each time after running the output file it gave me `ModuleNotFoundError: No module named 'pyautogui' `. It runs perfectly with .py file and I do not have more than 1 version of Python installed. pyautogui is also installed but it seems that it doesn't compile while creating exe using autopytoexe.
kerem closed this issue 2026-02-26 12:20:37 +03:00
Author
Owner

@Okeke-Divine commented on GitHub (Jan 17, 2021):

It has a problem maybe use pip to install pyinstaller

On Sunday, January 17, 2021, Aquib notifications@github.com wrote:

I tried creating exe multiple times, each time after running the output
file it gave me ModuleNotFoundError: No module named 'pyautogui' . It
runs perfectly with .py file and I do not have more than 1 version of
Python installed. pyautogui is also installed but it seems that it doesn't
compile while creating exe using autopytoexe.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/brentvollebregt/auto-py-to-exe/issues/151, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AQ544GHMSHCWJ7DXIXG3E6LS2LPGJANCNFSM4WGDGANQ
.

<!-- gh-comment-id:761813457 --> @Okeke-Divine commented on GitHub (Jan 17, 2021): It has a problem maybe use pip to install pyinstaller On Sunday, January 17, 2021, Aquib <notifications@github.com> wrote: > I tried creating exe multiple times, each time after running the output > file it gave me ModuleNotFoundError: No module named 'pyautogui' . It > runs perfectly with .py file and I do not have more than 1 version of > Python installed. pyautogui is also installed but it seems that it doesn't > compile while creating exe using autopytoexe. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/brentvollebregt/auto-py-to-exe/issues/151>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/AQ544GHMSHCWJ7DXIXG3E6LS2LPGJANCNFSM4WGDGANQ> > . >
Author
Owner

@aquib-sh commented on GitHub (Jan 17, 2021):

I tried uninstalling pyinstaller and auto-py-to-exe and installed them again. Still didn't work.

<!-- gh-comment-id:761817263 --> @aquib-sh commented on GitHub (Jan 17, 2021): I tried uninstalling pyinstaller and auto-py-to-exe and installed them again. Still didn't work.
Author
Owner

@brentvollebregt commented on GitHub (Jan 18, 2021):

@aquib-sh did you read the help post that I wrote up that is linked in the README, in the top of the UI and at the bottom of the UI after packaging a script?

Searching for "ModuleNotFoundError" in this post helped me immediately find the heading "ModuleNotFoundError: No module named x / ImportError: No module named x". I highly recommend giving this a read (that is why I have put it in so many places).

From the post:

To fix this in the UI, open the advanced tab and find the --hidden-import input. Simply paste the module name into this input and then repackage. If the original error is still appearing, you have done this incorrectly.

Alternatively, if you have put the module in here and the error is still occurring, make sure that the library you're trying to add is installed in the same distribution of Python that auto-py-to-exe is using - I have seen quite a few people get confused by this kind of situation before.

<!-- gh-comment-id:761961527 --> @brentvollebregt commented on GitHub (Jan 18, 2021): @aquib-sh did you read the help post that I wrote up that is linked in the README, in the top of the UI and at the bottom of the UI after packaging a script? Searching for "ModuleNotFoundError" in this post helped me immediately find the heading ["ModuleNotFoundError: No module named x / ImportError: No module named x"](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/#modulenotfounderror-no-module-named-x-importerror-no-module-named-x). I highly recommend giving this a read (that is why I have put it in so many places). From the post: > To fix this in the UI, open the advanced tab and find the --hidden-import input. Simply paste the module name into this input and then repackage. If the original error is still appearing, you have done this incorrectly. Alternatively, if you have put the module in here and the error is still occurring, make sure that the library you're trying to add is installed in the same distribution of Python that auto-py-to-exe is using - I have seen quite a few people get confused by this kind of situation before.
Author
Owner

@brentvollebregt commented on GitHub (Jan 19, 2021):

@aquib-sh if you search for "PyInstaller does not include a pre-compiled bootloader for your platform" in Google, there are a couple of discussions at:

In the PyInstaller issue linked above and also hinted in the SO answers, it may be your antivirus removing these. Check that your antivirus is not removing PyInstaller related files.

Original comment replied to (deleted)

File "c:\program files\python38\lib\site-packages\PyInstaller\building\api.py", line 532, in assemble
raise SystemExit(_MISSING_BOOTLOADER_ERRORMSG)
SystemExit:
Fatal error: PyInstaller does not include a pre-compiled bootloader for your
platform. For more details and instructions how to build the bootloader see
https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html

This is what it gave me after hidden-import... it doesn't make any sense I am using Windows 10 and I already have both GCC and Microsoft VS tools

<!-- gh-comment-id:763051718 --> @brentvollebregt commented on GitHub (Jan 19, 2021): @aquib-sh if you search for "`PyInstaller does not include a pre-compiled bootloader for your platform`" in Google, there are a couple of discussions at: - https://stackoverflow.com/questions/60010544/pyinstaller-pre-compiled-bootloader-not-found-and-build-fails - https://github.com/pyinstaller/pyinstaller/issues/4318 In the PyInstaller issue linked above and also hinted in the SO answers, it may be your antivirus removing these. Check that your antivirus is not removing PyInstaller related files. <details> <summary>Original comment replied to (deleted)</summary> > File "c:\program files\python38\lib\site-packages\PyInstaller\building\api.py", line 532, in assemble > raise SystemExit(_MISSING_BOOTLOADER_ERRORMSG) > SystemExit: > Fatal error: PyInstaller does not include a pre-compiled bootloader for your > platform. For more details and instructions how to build the bootloader see > https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html > > This is what it gave me after hidden-import... it doesn't make any sense I am using Windows 10 and I already have both GCC and Microsoft VS tools </details>
Author
Owner

@aquib-sh commented on GitHub (Jan 20, 2021):

@aquib-sh if you search for "PyInstaller does not include a pre-compiled bootloader for your platform" in Google, there are a couple of discussions at:

In the PyInstaller issue linked above and also hinted in the SO answers, it may be your antivirus removing these. Check that your antivirus is not removing PyInstaller related files.

Original comment replied to (deleted)

yes, I found it thats why deleted it

<!-- gh-comment-id:763613439 --> @aquib-sh commented on GitHub (Jan 20, 2021): > @aquib-sh if you search for "`PyInstaller does not include a pre-compiled bootloader for your platform`" in Google, there are a couple of discussions at: > > * https://stackoverflow.com/questions/60010544/pyinstaller-pre-compiled-bootloader-not-found-and-build-fails > * [pyinstaller/pyinstaller#4318](https://github.com/pyinstaller/pyinstaller/issues/4318) > > In the PyInstaller issue linked above and also hinted in the SO answers, it may be your antivirus removing these. Check that your antivirus is not removing PyInstaller related files. > > Original comment replied to (deleted) yes, I found it thats why deleted it
Author
Owner

@aquib-sh commented on GitHub (Jan 20, 2021):

I am putting the detailed solution here of how I was able to solve this issue.

After hidden import it gave
Gave Bootloader not precompiled error

steps taken:
cloning the pyinstaller github repo
python setup.py install
cd bootloader
python ./waf all --target-arch=64bit

placed the folder of output to exception in windows antivirus

adding modules to hidden import that had problem:
pyautogui
wave
aifc
pyaudio

THIS SOLVED THE ISSUE, HOPE SOMEONE WILL FIND USEFUL.

<!-- gh-comment-id:763614264 --> @aquib-sh commented on GitHub (Jan 20, 2021): I am putting the detailed solution here of how I was able to solve this issue. After hidden import it gave Gave Bootloader not precompiled error steps taken: cloning the pyinstaller github repo python setup.py install cd bootloader python ./waf all --target-arch=64bit placed the folder of output to exception in windows antivirus adding modules to hidden import that had problem: pyautogui wave aifc pyaudio THIS SOLVED THE ISSUE, HOPE SOMEONE WILL FIND USEFUL.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#143
No description provided.