1

I use windows 10 machines. whenever I open vscode and run the python program, by default it uses conda environment. I have tried many different things like selecting interpreter option in the left bottom corner, and settings like "python.PythonPath":"C:\\Users\\Nithin K Joy\\AppData\\Local\\Programs\\Python\\Python38\\python.exe","python.disableInstallationCheck":false, "python.terminal.activateEnvironment": true, "python.venvPath":"C:\\Users\\Nithin K Joy\\AppData\\Local\\Programs\\Python\\Python38\\python.exe", whatever I do it still runs on conda environment. The only thing that worked is removing conda path from system env and running vs code. But that is not a ideal way to deal. Anyone please help. Thanks in advance.

3
  • For me, "Python" extension saves the last selected interpreter and default settings. However, there's also a setting in Code preferences too. Commented Aug 29, 2020 at 11:21
  • But for me, that doesn't work bro.. Commented Aug 29, 2020 at 14:30
  • How did you install Anaconda? By default, doesn't it become the default Python installation? Commented Sep 1, 2020 at 20:45

1 Answer 1

6

You can add an entry for python.defaultInterpreterPath manually inside your User Settings,which is to set up a default interpreter for your applications. Restart the vscode to make the setting work.

Since python.pythonPath setting is being removed from all 3 scopes - User, workspace, workspace folder, more information you can refer to vscode-python-DeprecatePythonPath.

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

9 Comments

Thanks for replying. But when I add it to settings, it says "unknown configuration settings". and it didn't work.
Nope, i've tried and it works. what's your vscode version? Make sure that you put it in User settings. then close the vscode and open a clean folder, create a .py file and you'll find the environment is activated and the interpreter is the one you selected before.
I think its problem with my VScode version is 1.4.1. Anyway I uninstalled Anaconda, its a headache for me, and now I am using jupyter notebook in vs code by using Microsoft python extension. Thank you for replying and I am happy to give upvotes(2) to you.
@Nithin K Joy That's very kind of you, thanks a lot~
@MollyWang-MSFT Thank you for your superfast response :) After some trials it seems a workspace referred defaultInterpreterPath works as I expected. But as I am using VSC Remote connected via SSH to a remote machine, VSC doesn't accept any defaultInterpreterPath config. I am stuck to VSC version 1l50.1 currently.
|

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.