On 1/30/21 2:58 PM, Philipp Daher via Python-list wrote:
Dear Python-Team,

I have just repaired python after running my program which imports pyautogui, 
closing and reopening it and then getting this: ModuleNotFoundError: No module 
named „pyautogui“. Repairing didn’t work and I still get that message. All I 
did was closing the perfectly working program in 3.9.1 and reopening it in 
3.9.1, but after the reopen I got the message. I’ve tried looking for solutions 
in at least seven developer forums, nothing worked. If it helps, I have Python  
3.8 installed on my PC also.

I hope you can fix my troubles.

We can't fix it, but maybe point you to some things to let you fix it :) Sorry if you've already seen this.

Remember: a missing module is a path problem. The module is either someplace, or it isn't ("not actually installed" happens often, but apparently isn't your case since things worked previously). And your Python isn't looking in the place the module is (or isn't).

Find where the module is installed.
Ask Python where it's looking. Here's a sample interactive session:

$ python
Python 3.8.7 (default, Dec 22 2020, 00:00:00)
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib64/python38.zip', '/usr/lib64/python3.8', '/usr/lib64/python3.8/lib-dynload', '/home/mats/.local/lib/python3.8/site-packages', '/usr/lib64/python3.8/site-packages', '/usr/lib/python3.8/site-packages']


This article might be a starting point (it's not actually a great article IMO, but it's referenced from several places on the net and it does cover a lot of the topics):

https://coderslegacy.com/python-no-module-named-import-error/

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to