ModuleNotFoundError: No module named 'pyautogui' on Python 3.8.6See original GitHub issue
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.
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@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.
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.