After utilizing pip to install pyautogui successfully to my Python3.10 environment I'm utilizing in Visual Studio, I'm still getting this error when trying to simply import the library.
Warning (active) reportMissingImports Import "pyautogui" could not be resolved
I know it's installed to my correct repo, as I can see PyAutoGui (0.9.53) listed under packages of my active environment from the Solution Explorer. I also have th
I've tried a good few attempts to reinstall using pip and pip3 in separate attempts, but get "Requirement already satisfied" in return.
I'm new to Python and programming in general so any tips or assistance would be appreciated.
I've had similar issues like this before.
What python does is it looks in it's site-packages folder for the package, If you have multiple python versions installed sometimes the packages will be installed for one python version instead of the one you want.
This is what you can do.
Run
pip show pyautogui
This should output something like this:
/Users/<user>/.local/share/virtualenvs/place/lib/python3.8/site-packages
This is where your pyautogui module is installed at.
Now using python run this code.
import sys
print(sys.path)
Now the sys.path should contain the same site-packages path shown when we ran 'pip show pyautogui'
If sys.path does not contain the pyautogui site-packages path then that means pip installed pyautogui for the wrong python version.
I believe running pip with this command should install pyautogui to the correct python version.
python<version> -m pip install pyautogui
Example:
python3.8 -m pip install pyautogui
You can find out your python version by running:
python --version