Rolling back Python version

Hi all, I noticed that Manjaro is already on Python 3.9, which is not supported by Tensorflow yet. What’s the easiest way I can roll back my Python version to 3.8? I noticed that there are AUR packages I can install, but is it also possible to do this with the official repositories?

Not a direct solution, but:
I like to use pyenv which easily lets me install and manage multiple python versions.

Just do a quick

sudo pacman -S pyenv
pyenv install 3.8
pyenv global 3.8

Might be working for you even better! :slight_smile:

1 Like

It works, thanks @coffeeri. The only change to your suggestion was that I had to add the following to my bashrc:

eval “$(pyenv init -)”

otherwise the pyenv version won’t get used.

Does pyenv become the python package manager then? In other words, how does it work with pacman if you want both python 3.8 and 3.9 installed.

Yes indeed, you will not need pacman to install python versions, when using pyenv.

I looked in /var/cache/pacman/pkg and there is python 3.9 and python 3.8. In /var/lib/pacman/local python 3.9 is installed, which is confirmed by pacman -Qi python.

I don’t remember pacman asking me if I wanted to replace or keep 3.8. Do you have to do anything special? Do you install the AUR python 3.8?

I suppose the same procedure might be true for java.

Thank you.

Python is considered a system component and as such it will be updated with the system. Follow release notes and check the list of packages on system update to catch updates which requires intervention on your side.

Vital system applications such as gcc, python and probably others as well - will always be updated - this is not a user choice - it is system standard.

If you need earlier versions of e.g. Python you will have to install and maintain an AUR package. The same goes for other system components.

I saw the announcement for python. I’m using the RSS Feed.

There’s nothing like the alternatives system?

Is Java handled the same way as Python?

No, Java isn’t “system component” in Manjaro.
You can install more versions from repositories freely and then use command archlinux-java to setup default one.

not necessarily. @coffeeri’s solution with pyenv worked quite well for me. the only thing remaining is to get ipython to use the right version, otherwise it works great.

Cool.

I see how pyenv works, I just don’t see where python versions are being download from.

Does pyenv replace pip?

Not sure how pyenv works in practice. Maybe this helps, personally I don’t have much depth into it: GitHub - pyenv/pyenv: Simple Python version management

I noticed that pip transitions from one version to another almost seamlessly. The python packages appear to be different for each major version.

pyenv root

shows where versions are located

If this topic ever comes up for Ruby, the answer is rvm :slight_smile: I recently ran into this when looking at asciidoctor. It seems a user can install a version of ruby, asciidoctor and asciidoctor gems locally ($HOME) without polluting the entire system.