sudo update-alternatives –config . How to set the auto entry

I’m trying to run a script that does somewhere: python egg_info
This gives me an error.
But if I manually do : python3 egg_info I don’t get the error.

Therefore I tried to sudo update-alternatives --config python . This gives:

  Selection    Path                 Priority   Status
  0            /usr/bin/python3.10   2         auto mode
* 1            /usr/bin/python3      1         manual mode
  2            /usr/bin/python3.10   2         manual mode
  3            /usr/bin/python3.8    0         manual mode

This should redirect the script to the right version of python.
But it still doesn’t work . My guess is that it is because python3.10 is still the auto mode version.

Is there something I can do about this?

Many thanks in advance!!

Asked By: Rutger Moody


Compare the python and python3 symlinks in /etc/alternatives/ (e.g. with ls -lF /etc/alternatives/python*.

My guess is that python points to python3.8 while python3 points to python3.10. Or vice-versa.

Is there any particular reason why you want python to run 3.8 instead of 3.10? if not, run update-alternatives again and set it to either auto (preferred) or to 3.10 (you’ll run into the same problem in future when 3.11 or 3.12 or whatever is the latest auto version).

Or just make sure that the alternatives symlinks for python and python3 point to the same version of python.

Answered By: cas
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.