Answer the question
In order to leave comments, you need to log in
Import requests work in IDLE but not in vscode. How to fix?
Installed python 3.10.2 via homebrew. In vscode, the python 3.10.2 interpreter is selected, but when trying to import, it gives the message: "ImportError: No module named requests". How can I get requests imported into vscode?
Answer the question
In order to leave comments, you need to log in
The correct way to do this is to create a virtual environment, in the terminal cd
to the project directory (with a virtual environment), then execute the command code .
(at the end - a dot separated by a space).
Perhaps you have several versions of Python installed and you need to select the desired interpreter in VSCode
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question