Python is updated

From the height of my Linux ignorance, I was quite surprised to see python packages were part of the updates we receive. That just crashed everything I was working on since this current version (3.13.2) is not supported and seem to be the default for the entire OS.

I thought venv was meant to isolate different python environments but apparently not that well. My different projects using pytorch or torchvision were using 3.11 or 3.12 venv but they don’t start anymore because of ‘you have 3.13.2’.

It is possible to stop those python updates?

Someone would know how to truly isolate an environment with a specific version of Python?

@Aerth Not really, Tumbleweed rolls this way… I would suggest using distrobox for your development…

/usr/bin/python3 is a symlink to the system python. If you created a venv just by going /usr/bin/python3 -m venv than your environments interpreter will change when the system moves its default from one to the other.

The best way to create a venv is be specific with which python binary you’re developing against.

Your system still has 3.11 installed, you just need to create a new venv with python 3.11 and deploy into that.

Basically, you do not want to stop updates. You do want to be specific about what version of Python you are deploying with.

1 Like

Thanks to both of you.

I am fine with updates, that is why I am using a rolling distro. I didn’t know they would impact languages and what I consider user elements.

I depend on some python modules and I can’t change them. They support python at least 3.10.x., which is still supported for 18 months, up to 3.12.

All my projects are in venv actually since the start with precise versioning. I thought it worked as you describe, until yesterday when everything stopped to work.

if I do a
xxxxxx@localhost:~/temp> python3.11 -m venv ~/.venv/3.11
xxxxxx@localhost:~/temp> source ~/.venv/3.11/bin/activate

What I get if I request the version is:
(3.11) xxxxx@localhost:~/temp> python --version
Python 3.13.2

I may be wrong, hence my question.

I am ok to correct things and reinstall modules and stuff in a corrected venv. But if I cannot control the python version exactly I will have to turn on a Windows box where I can do that easily.
I frankly would want to avoid that :slight_smile:

is ~/.venv/3.11 new or was it a previous venv, because that shouldn’t happen.

This is what should happen

~/pytest> python3 -mvenv test1  
~/pytest> ls -al test1/bin/python*  
lrwxrwxrwx. 1 x x  7 Mar 12 13:25 test1/bin/python -> python3
lrwxrwxrwx. 1 x x 16 Mar 12 13:25 test1/bin/python3 -> /usr/bin/python3
lrwxrwxrwx. 1 x x  7 Mar 12 13:25 test1/bin/python3.13 -> python3
~/pytest> python3.11 -mvenv test2
~/pytest> ls -al test2/bin/python*
lrwxrwxrwx. 1 x x 10 Mar 12 13:25 test2/bin/python -> python3.11
lrwxrwxrwx. 1 x x 10 Mar 12 13:25 test2/bin/python3 -> python3.11
lrwxrwxrwx. 1 x x 19 Mar 12 13:25 test2/bin/python3.11 -> /usr/bin/python3.11
~/pytest> source test1/bin/activate
(test1) x@host:~/pytest> python3 -V
Python 3.13.2
~/pytest> deactivate
~/pytest> source test2/bin/activate
(test2) x@host:~/pytest> python -V
Python 3.11.11

Try creating an alias instead and use ‘python3’…

alias python3=/usr/bin/python3.11

python3 --version should show Python 3.11…

1 Like

Did this just get posted because its at the top but idk.

It was created for this topic to test it again and show you what I got.
But, I used exactly what you did and I have exactly the same results you got … I will redo all my stuff using this kind of instruction and test again.

If it solves or not my issue, thanks a lot for the time and effort you dedicated to this. :grinning:

Thank you for your response.
I thought about alias but didn’t go further because I figured that if Tumbleweed installs and updates Python it could be because it uses it in tool or process. Changing the expected version could bring other issue.

I feel like I remember there being a tool where you could pick which version of Python you want to use by default, but I can no longer find it on my system.

Thank you Amiya. If you ever found it I will be happy to try it. It could be super useful to test pieces of code for example :slight_smile:

@amiya Likely update-alternatives?

That’s what I thought I remembered, but if it once had the ability to change the version of python used, it seems it no longer does.

Pyenv might be something to check out if you need more control over python versions

1 Like

I also second that having used pyenv to avoid tying my development python to the system’s python. There is a also a new alternative called uv.

UV: An extremely fast Python package and project manager, written in Rust.

2 Likes