0

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.
    – puio
    Aug 29, 2020 at 11:21
  • But for me, that doesn't work bro.. Aug 29, 2020 at 14:30
  • How did you install Anaconda? By default, doesn't it become the default Python installation?
    – AMC
    Sep 1, 2020 at 20:45

1 Answer 1

5

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.

9
  • Thanks for replying. But when I add it to settings, it says "unknown configuration settings". and it didn't work. Aug 31, 2020 at 9:49
  • 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. Aug 31, 2020 at 10:04
  • 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. Sep 1, 2020 at 11:08
  • @Nithin K Joy That's very kind of you, thanks a lot~ Sep 2, 2020 at 1:19
  • 1
    @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.
    – fmfreeze
    Nov 26, 2021 at 11:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.