I used pip install fastapi to download it in my virtual environment, in terminal but when I try to import from it it shows up as a missing import.
I used pip install fastapi to download it in my virtual environment, in terminal but when I try to import from it it shows up as a missing import.
If you want to install a package into your specific virtual environment, you need to first "activate" that environment. Likewise, if you want to run your script in that environment, you need to first "activate" it. You can do this manually but preferably let VSCode handle it for you.
In order to tell VSCode(especially the language server which is pylance) to use that environment:
"python.terminal.activateEnvironment": true to your setting.json file. This will automatically activate your venv whenever you open your integrated terminal.Please select the appropriate interpreter for your running environment.
ctrl+shift+P
and then choose the one like picture.