Visual Studio Code is using Python interpreter that does not exist?

Hi!
I have a problem with different python versions. My terminal shows Python 3.8 but in VSC it says 3.9. However I can not change to 3.8 inside of VSC, neither can I find the path VSC is showing (/bin/python) in my files. I attached the screenshots. I just installed zorin and VSC (no python myself). Now I am wondering:

  1. Why do I have 2 versions of python?
  2. Why can I only find version 3.8 in my files?
  3. How do I manage to only have one version of python?

Thanks :slight_smile:


Terminal
VSC

To see if you got python 3.9 installed or not, open Synaptic and search with python 3.9.

As you can see in my screen shot, it is possible to install 3.9.
How it will interact with python 3.8, I do not know.

When you try to install it, it might tell you to uninstall 3.8, but I am just guessing.

2 Likes

Python 3.9 is not installed, yet VSC says so and is able to run python files. I was thinking maybe it just shows the wrong version and is actually using 3.8, but the python libraries I installed in the terminal are not working so it really seems to be using a different python. Super weird :confused:

Is VSCode installed as a Snap or Flatpak?

3 Likes

Yes, I installed it as a Flatpak. Now I deinstalled the Flatpak and downloaded the .deb file instead and it works. I am really new to this, but in my understanding downloading flatpaks or snaps works more like windows (all dependencies are installed again). Is that why it also installed Python again? Does that mean using the Software App on Zorin is always not ideal?

1 Like

As you have just experienced, Flatpak and SNAP may solve a issue of dependency but could introduce another problem.

Most of us prefer traditional apt installation.
To avoid accidentally install Flatpak or SNAP version of the applications, I usually install applications in terminal or Synaptic.

2 Likes

Got it, thanks :slight_smile:

1 Like

Yes, it carried its own version of Python with it.

Snap and Flatpak are both promoted as Complete, totally up-to-date packages that Solve all dependency issues.
Sounds great.
Unfortunately, not true.

As @FrenchPress noted above, sometimes it can create a working situation. But sometimes, its very nature of boxing itself in with its own dependencies is what causes it to not work because it is operating independently of the system in which it needs to be able to interact in order to work.

It also can really confuse a person by saying they have something that they do not have installed that the rest of their system could use. Imagine a situation where you were trying to install other software which depends on python 3.9. You would believe you have 3.9 because that Flatpak packages says that you do. This can cause all manner of problems while you try to solve a non-existent problem. It may even break your system as you try to reinstall a python version you do not even have.

3 Likes

Thank you so much for the detailed explanation! And yes, I broke my system because of that issue :smiley:

2 Likes