7

I've been using a python interpreter that I set in my venv the whole time for this project. Recently I changed my python interpreter which I've set as a default interpreter in my user settings like the vs docs vs code python environments describes it and also set in my JSON settings file refuses to load instead. I'm getting the default conda python interpreter with no other options.

here is my Json file:

settings.json

{
  "python.defaultInterpreterPath": "C:/Users/houst/Envs/Mach/Scripts/python.exe"
}
3
  • Try installing the python package from the extensions tab Commented Feb 9, 2022 at 12:29
  • I uninstalled it and reinstalling but I'm still getting the same problem. Commented Feb 9, 2022 at 13:21
  • Have you tried using double backslashes instead since that's what windows file paths need (as shown in the documentation)? Commented Feb 20, 2022 at 8:29

2 Answers 2

1

I think you should use the \ instead of the / in the path. For safety just copy paste the path from the windows explorer.
Another Solution : Writing the path in Json should definitely work. But I prefer using the functionality vscode provides. Now come to my solution. press ctrl+shift+p to open the search bar. now type >Python:Select Interpreter. This should allow you to select the existing interpreter or to add the interpreter path in the vscode. I'm attaching a screen shot for your convenient.

VsCode Python Interpreter

You should keep in mind that, if you add the Python interpreted path in environment path of your system, vscode should automatically find the interpreter.

Sign up to request clarification or add additional context in comments.

Comments

0

I've found that opening the folder in which the virtual environment was made allows VScode see the interpreter. When I open a subfolder I want to work on, without opening the parent folder in which the virtual environment was created, VScode won't see the interpreter.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.