An Invalid Python interpreter is selected, please try changing it to enable features such as IntelliSense, linting, and debugging

Viewed 50

I am trying to import flask using python on vs code. I have installed the python 3.10.7, added its path into environment variables and even entered the python.exe file's location manually into find python interpreter bar, still python interpreter is not working. please help me in solving this.

2 Answers

Have you actually installed Flask?

pip install Flask

Please provide more information so people can help you solve your problem

First make sure that python is installed correctly (can the external terminal run python), then install the Python extension in vscode. It will be helpful to follow this article.

Possible workarounds:

Add the following configuration to the settings.json to specify the python interpreter path

    // Example path, please modify it to your own python interpreter path
    "python.defaultInterpreterPath": "c:/WorkSpace/PyTest0616/.venv1/Scripts/python.exe",

Then select the interpreter you just configured in the Select Interpreter panel

enter image description here

Related