I have a simple python:
import requests
import keyboard
resp = requests.get('http://www.google.com')
keyboard.send('A')
This is an example.
When I run this code with python main.py
everything is ok, but in VSCode the second line is underlined because "unresolved import 'keyboard' "
The first line is not underlined. Pyinstaller is the biggest problem. After generating the .exe file does not work because:
ModuleNotFoundError: No module named "keyboard"
Both modules are installed
It sounds like you need to configure VsCode to use the same interpreter as the one that the module is installed in, i'm not a VsCode advocate so I don't use it but I know it's possible. This might help you out: https://code.visualstudio.com/docs/python/environments
To select an specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).