Python Forum
Import Errors - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Import Errors (/thread-31021.html)



Import Errors - swimmDude1 - Nov-18-2020

I am a beginner beginner in python and when I try to import pyautogui it says it isn't installed though when I install it it says the requirement is already met. I am using visual studio code. Can anyone help me out? When I look at other posts like this one, I still don't know what to do.


RE: Import Errors - snippsat - Nov-18-2020

Look down in left corner(mouse over or click) of VSCode,then you see which python version/interpreter it use now.
So most match version used to install this from command line.
Quick demo.
# Test python
C:\code
λ python -V
Python 3.8.3

# Test pip,see path it install to
C:\code
λ pip -V
pip 20.2.3 from c:\python38\lib\site-packages\pip (python 3.8)

# Install
C:\code
λ pip install pyautogui --upgrade
Collecting pyautogui
  Downloading PyAutoGUI-0.9.52.tar.gz (55 kB) .....
Successfully installed PyTweening-1.0.3 mouseinfo-0.1.3 pyautogui-0.9.52
pygetwindow-0.0.9 pymsgbox-1.0.9 pyperclip-1.8.1 pyrect-0.1.4 pyscreeze-0.1.26
So now i know that Python 3.8 most be used as interpretee down in left corner VSCode.
If take mouse over it will show path c:\python38,the same path that pip -V show.
Some more install/setup tips here VS Code from start