0

I have many python versions installed. I need nevertheless that when using VSC the script be run by python3.10.7. I changed accordingly the interpreter in VSC to the latest python version. The latest python version, python3.10.7, is installed in the folder /user/bin, while the one which I get with which python is installed in a different folder, home/myname/anaconda3/bin/python. I will appreciate your help. I use Ubuntu 20.4. I do not have experience in using virtual environments. How do I change the interpreter to the latest one ? Thanks for your help.

user996159
  • 149
  • 6

1 Answers1

0

you can do it by opening the Command Palette using Ctrl+Shift+P and enter Preferences: Open User Settings. Then set python.defaultInterpreterPath, which is in the Python extension section of User Settings, with the appropriate interpreter.

  • I have done it as I pointed out at my post. The VSC is linked to the latest version. In the terminal however, when I check for the version used, I get `python3.9.7` instead of what VSC is linked to, `python3.10.7`. In fact, when I run some code that is supported only in `3.10.7`, I get an error message, showing that the code is not run by the interpreter I want. – user996159 Sep 27 '22 at 10:13
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 30 '22 at 15:42