0

Right now the python3 version is 3.7.3 on my Raspberry Pi 4.

Generally, it is a bad idea to mess with the system Python (I've understood), but since I use 3.7.9 normally, I would like to have that installed.

Should I

  1. Just make an altinstall having 3 python versions (2,3.7.3 and 3.7.9)
  2. Upgrade the 3.7.3 to 3.7.9 (and in case, how?)
  3. Is it safe to point python3-->python3.7 in case of (2), or can that break something?
6
  • 1
    Well, it depends on your linux knowledge and experience. I once thought I was a clever guy and tried to upgrade Rpi3B+ Python 3.5.3 to 3.7.3. It took me a couple of hours to make a big mess which was mission impossible to clean up. Now I am a friendly, humble, wise guy. :)
    – tlfong01
    Jan 28 at 9:31
  • 1
    so eventhough it is just a minor-version upgrade, we should just stick to an altinstall and keeping the 3.7.3 ?
    – CutePoison
    Jan 28 at 9:39
  • Well, no pain no gain. I remember I learned many new things which I didn't know that I didn't know, which are very useful in my latter Rpi projects which I must use CLI commands. But these years Rpi GUI is getting more and more friendly, especially in package installations. I am finding it more and more often that in some tricky cases clever linux old hands still go down the dark alley, while humble guys like me use Rpi OS GUI install (which is getting more and more user friendly can newbie considerate). get the job done easily, and much more quickly. An analogy is asm > C > python.
    – tlfong01
    Jan 28 at 10:12
  • What feature will you get from the upgrade BTW? Jan 28 at 10:33
  • Tbh, I dont know if there is a feature difference - but since Im using 3.7.9 for work, and all my other projects it can happen, that I cannot transfer the scripts from my RPI to work. So it is simply to be on the sure site
    – CutePoison
    Jan 28 at 16:12
2

The safest option would be to install your custom Python in /usr/local

./configure --prefix=/usr/local
make
make install

You'll have to either call it as /usr/local/bin/python3 or set a custom PATH where /usr/local/bin/ comes ahead of /usr/bin/.

Since there is no Python 3.7.9 for Buster, you cannot upgrade the system Python without upsetting the package manager.

1
  • 1
    "or set a custom PATH where /usr/local/bin/ comes ahead of /usr/bin/" i.e.the standard for all Linux distributions
    – Milliways
    Jan 28 at 11:10
1

If you want to use a stable OS based on Debian accept the "limitations" i.e. it mostly is tested and WORKS.

There are "cutting edge" OS.

If you REALLY need a later version of python it is not that difficult to install from source (although it takes a while) - BUT why 3.7.9? the current is 3.9, which you will get in Bullseye in a few months. You could probably find a compiled version if you search the pre-release of Bullseye.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.