Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Python Update Alternatives Not Working?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
dachshund-digital
Posts: 40
Joined: 2021-12-23 22:22

Python Update Alternatives Not Working?

#1 Post by dachshund-digital »

I can't seem to get python link to show 3.9.9... It always points to 3.9.2, Debian 11 default. In fact, python3 is not shifting to 3.9.9 either. But update-alternatives seems to be setup right.

# update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/python3.9 2 auto mode
1 /usr/bin/python3 1 manual mode
* 2 /usr/bin/python3.9 2 manual mode

Press <enter> to keep the current choice[*], or type selection number:

# ls -l /usr/bin/python*
lrwxrwxrwx 1 root root 24 Jan 14 07:48 /usr/bin/python -> /etc/alternatives/python
lrwxrwxrwx 1 root root 9 Apr 5 2021 /usr/bin/python3 -> python3.9
-rwxr-xr-x 1 root root 4703672 Mar 11 2021 /usr/bin/python3.9
lrwxrwxrwx 1 root root 36 Mar 11 2021 /usr/bin/python3.9-config -> arm-linux-gnueabihf-python3.9-config
lrwxrwxrwx 1 root root 16 Apr 5 2021 /usr/bin/python3-config -> python3.9-config

# python --version
Python 3.9.2

# python3 --version
Python 3.9.2

User avatar
canci
Global Moderator
Global Moderator
Posts: 2502
Joined: 2006-09-24 11:28
Has thanked: 136 times
Been thanked: 136 times

Re: Python Update Alternatives Not Working?

#2 Post by canci »

Did you install 3.9.9 manually? update-alternatives won't show manually installed options. I'm not sure how to manually add those, but maybe the manpage has more?
Image Stable / Asus VivoBook X421DA / AMD Ryzen 7 3700U / Radeon Vega Mobile Gfx (Picasso) / 8 GB RAM / 512GB NVMe

READ THIS:

* How to Post a Thread Here
* Other Tips and Great Resources

dachshund-digital
Posts: 40
Joined: 2021-12-23 22:22

Re: Python Update Alternatives Not Working?

#3 Post by dachshund-digital »

Yeah, it was a manual install, i.e. compile. I explicitly added it to update-alternates, but I haven ot had time to get back to this issue, given other priorities. But I will at some point.

Robert09
Posts: 1
Joined: 2022-03-31 06:24

Re: Python Update Alternatives Not Working?

#4 Post by Robert09 »

I am installing a more recent version of python for to make an app for my project X8 speeder. I used `sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python2.7 1`

`python --version` still yeilds Python 2.6.6

`update-alternatives --config python` shows this

There is 1 program that provides 'python'.

Selection Command
-----------------------------------------------
*+ 1 /usr/local/bin/python2.7


Is there something I'm missing? Seems update-alternatives knows about my python 2.7 install, but the system doesn't use it.

Post Reply