Visual Studio Code – Python Interpreter path does not work for me

Issue

I am doing the Tutorial of Django on Youtube, which can be found on the following URL: https://www.youtube.com/watch?v=rHux0gMZ3Eg
After creating a virtual environment and starting a project in Virtual Studio Code, he tries to add the python path into the VSCode.
In the video he is then able to use Python from the terminal inside the VSCode.

However, around minute 19 you can find that in the video. If I do it by myself, nothing is happening and I am also not able to use Python on the VSCode then. I did not figure out, what I am doing wrong, since I am exactly doing it like in the video.
Does anyone have an idea, what I am doing wrong here?

Solution

After you added C:\Users\User\.virtualenvs\storefront-XXXX\Scripts\python.exe in the Command palette you have switched the python interpreter. You can find it out from the bottom-right on the VSCode, looks like this:

enter image description here

But it will not work in the older terminal which opened before switching the python interpreter. You need to create a new terminal(shortcut: Ctrl+Shift+`). That’s why after you restart it will work.

Answered By – Steven-MSFT

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published