Sublime Forum

Linux ST3 using mystery Python version

#1

Hello!
I am coming over to Sublime Text 3 on Linux from windows and I am running into something that I can not fix.

I am using POP!_OS 20.04 LTS and have installed ST3 from the Pop!_Shop. When I am running Python, ST3 and the terminal use different versions of Python. I noticed this when I installed the numpy python module from the terminal and ST3 was throwing errors about not finding it.

When the python module import did not work from ST3(import numpy), I called the file from the terminal and it imported the module without issue.

I have made sure that the the build system I am using is targeting the correct python version(or so I think…). The odd thing is, I can’t seem to find any installation files relating to python 3.7 (the version that ST3 is running) on my machine.

I don’t know what is going on with this error, can anyone offer any help or suggestions?

Thanks,
Jason

0 Likes

#2

ST bundles it’s own version of Python and doesn’t use the system python. So when you install modules, ST won’t use them as they are using the same python. To install modules into ST’s python, you need to create dependencies. See Package Control dependencies for examples.

0 Likes

#3

Thanks for the reply! Is there a way to force ST3 to use the system python? That is what I thought I was doing in the .sublime-build file.

0 Likes

#4

Sublime Build files can use system python, but the plugins and console will use the packaged ST python. Sorry for the confusion. I was on my phone and it didn’t load all of the post. Let me re-address the issue.

Does /usr/bin/python3.8 work? This is indeed odd. I would say, perhaps your user profile and the build system are using different env variables causing this difference in python versions

0 Likes

#5

I tried the python3.8, that doesn’t work. However, in the usr/bin/ folder there is a python3.8, but it just links to /usr/bin/python3 file itself.

0 Likes

#6

All,

Thanks for looking and trying to give this some thought.

I managed to fix this issue. Here is how:
-Uninstall SublimeText 3 from the Pop!_SHOP
-Install SublimeText3 as listed on SublimeText’s website:
https://www.sublimetext.com/docs/3/linux_repositories.html

From this point on, everything worked fine. Python from ST3 was reporting the same version, executable, and path structure as the terminal.

No idea what is different between the Pop!_Shop and the traditional linux install.

Thanks again!
Jason

0 Likes

#7

I’m not familiar with this particular distro, but the fact that both paths appear to be identical even though running them produces visibly different results, combined with installing ST3 from “The Pop!_shop” (an unofficial, unsupported repackage) makes me wonder if this is something akin to app images or flatpacks that run in a chroot jail of some kind so they can pack in their own dependencies and be standalone.

If that was the case, my suspicion would be that when they repacked ST3 for their store they also bundled with it some version of Python as well, and due to the way it operates Sublime can only see the version that it’s packaged with and not anything else.

That’s just a guess, though.

0 Likes

#8

The fact that they appeared to be calling Python from the same path with different results had me pulling my hair out.

One similar thought I had was that they did a repackage of it as well. On distrowatch, it showed the previous version of Pop! was released on 19-OCT-2019. Python 3.7.4 (what I saw in my ST3 output) was released on 08-JUL-2019, and Python 3.7.5 was released on 15-OCT-2019. ST3’s current build was released on 1- OCT-2019.

I think there is some evidence that you are correct. It’s possible the Pop! team grabbed a build of ST3, bundled it with the current Python version at the time, added it the the Pop!_Shop, and have not touched it since. All speculation though.

Thanks for the reply!

0 Likes

#9

Off-topic but what is that color scheme? Looks nice.

0 Likes

#10

I am using:

Theme: Afterglow --> Afterglow-orange
Color Scheme: Afterglow-Monokai

Enjoy!

0 Likes