Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide Python update
#4
So let's take a look at the /usr/bin/ directory

Code:
pi@rpi4b2:~ $ ls -l /usr/bin/python*
lrwxrwxrwx 1 root root       7 Mar  4  2019 /usr/bin/python -> python2
lrwxrwxrwx 1 root root       9 Mar  4  2019 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 2984816 Oct 10  2019 /usr/bin/python2.7
lrwxrwxrwx 1 root root      36 Oct 10  2019 /usr/bin/python2.7-config -> arm-linux-gnueabihf-python2.7-config
lrwxrwxrwx 1 root root      16 Mar  4  2019 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root       9 Mar 26  2019 /usr/bin/python3 -> python3.7
-rwxr-xr-x 2 root root 4275580 Jul 25  2020 /usr/bin/python3.7
lrwxrwxrwx 1 root root      36 Jul 25  2020 /usr/bin/python3.7-config -> arm-linux-gnueabihf-python3.7-config
-rwxr-xr-x 2 root root 4275580 Jul 25  2020 /usr/bin/python3.7m
lrwxrwxrwx 1 root root      37 Jul 25  2020 /usr/bin/python3.7m-config -> arm-linux-gnueabihf-python3.7m-config
lrwxrwxrwx 1 root root      16 Mar 26  2019 /usr/bin/python3-config -> python3.7-config
lrwxrwxrwx 1 root root      10 Mar 26  2019 /usr/bin/python3m -> python3.7m
lrwxrwxrwx 1 root root      17 Mar 26  2019 /usr/bin/python3m-config -> python3.7m-config
lrwxrwxrwx 1 root root      14 Mar  4  2019 /usr/bin/python-config -> python2-config

  • note that python3.8 isn't installed in RaspiOS 10.6; it would have to be 
  • pythonic programmers will usually invoke the specific python version they want 
  • the symlink /usr/bin/python can be changed to point to the version of choice
However, directly changing that symlink is old-style Linux administration. The new style (at least in Linux'es derived from Debian) is to use the alternatives system.

Here's the start of the man page for update-alternatives

Quote:update-alternatives(1)                                       dpkg suite                                       update-alternatives(1)

NAME
       update-alternatives - maintain symbolic links determining default commands

SYNOPSIS
       update-alternatives [option...] command

DESCRIPTION
       update-alternatives  creates,  removes,  maintains  and  displays  information about the symbolic links comprising the Debian
       alternatives system.

       It is possible for several programs fulfilling the same or similar functions to be installed on a single system at  the  same
       time.   For  example,  many systems have several text editors installed at once.  This gives choice to the users of a system,
       allowing each to use a different editor, if desired, but makes it difficult for a program to make a good choice for an editor
       to invoke if the user has not specified a particular preference.

       Debian's  alternatives  system aims to solve this problem. ...

I'm a dinosaur stuck in old style LInux. Rather than try to explain the alternatives system I'll leave it at "use your favorite search engine."

Regards,
Kent
Reply


Messages In This Thread
Python update - by jmperagine - 10-11-2021, 03:28 PM
RE: Python update - by vinnn - 10-11-2021, 03:33 PM
RE: Python update - by jmperagine - 10-13-2021, 08:05 PM
RE: Python update - by Tim Curtis - 10-11-2021, 03:51 PM
RE: Python update - by jmperagine - 10-13-2021, 08:06 PM
RE: Python update - by TheOldPresbyope - 10-11-2021, 04:45 PM
RE: Python update - by jmperagine - 10-13-2021, 08:12 PM

Forum Jump: