View previous topic :: View next topic |
Author |
Message |
jagdpanther l33t
Joined: 22 Nov 2003 Posts: 763
|
Posted: Wed Oct 23, 2024 1:35 am Post subject: [solved] Current Python Version Selection |
|
|
I know that "eselect python" is the old way to select python versions. Also according to https://wiki.gentoo.org/wiki/Python "eslect python" still is a wrapper to /etc/python-exec/python-exec.conf. The only uncommented lines in my /etc/python-exec/python-exec.conf are:
Code: | python3.12
python3.11 |
So why is my gentoo system reporting that it will remove python-3.11 when I run "emerge --depclean -p" ?
(I want to keep python-3.11 because I have some 3rd party stuff, stable diffusion, that currently uses python-3.11.)
Where is the documentation for the current proper way to tell Portage to keep a specified version of Python?
Thanks.
Last edited by jagdpanther on Wed Oct 23, 2024 2:45 am; edited 1 time in total |
|
Back to top |
|
|
bstaletic Guru
Joined: 05 Apr 2014 Posts: 378
|
Posted: Wed Oct 23, 2024 2:30 am Post subject: |
|
|
Either your @world does not mention dev-lang/python or it has no version nor slot specification.
Your entire system can be rebuilt with just python 3.12, so portage is fine with trying to remove python 3.11.
python-exec.conf is not in this equation at all.
What you can do is add python 3.11 to your world set. emerge -u python:3.11 should do the trick.
That way, some version of python 3.11 will remain in your @world set. |
|
Back to top |
|
|
jagdpanther l33t
Joined: 22 Nov 2003 Posts: 763
|
Posted: Wed Oct 23, 2024 2:44 am Post subject: |
|
|
bstaletic:
Thank you. Your suggestion fixed the issue.
(And you were correct, I checked /var/lib/portage/world and there were no dev-lang/python:3.x entries.) |
|
Back to top |
|
|
jagdpanther l33t
Joined: 22 Nov 2003 Posts: 763
|
Posted: Sun Oct 27, 2024 6:01 pm Post subject: |
|
|
Quote: | python-exec.conf is not in this equation at all. |
I guess I did not read that statement properly: I commented out the two lines in /etc/python-exec/python-exec.conf from my original post. Everything seemed to work fine. Then python3.13 was pushed out via portage but is not the system python. I then tried to run pithos and received:
Code: | Traceback (most recent call last):
File "/usr/bin/pithos", line 8, in <module>
from gi.repository import Gio
ModuleNotFoundError: No module named 'gi' |
media-sound/pithos-1.6.2 is a python script launched with
Code: | #!/usr/bin/env python3 |
With all lines commented out in python-exec.conf I get:
Code: | $ eselect python list
Available Python interpreters, in order of preference:
[1] python3.13 (fallback)
[2] python3.12 (fallback)
[3] python3.11 (fallback) |
So I changed python-exec.conf to:
Code: | python3.12
python3.13
python3.11 |
Which fixes the issue and now have:
Code: | $ eselect python list
Available Python interpreters, in order of preference:
[1] python3.12
[2] python3.13
[3] python3.11 |
Is modifying /etc/python-exec/python-exec.conf the current Gentoo suggested method of choosing which python3 is run by default? |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2453
|
Posted: Sun Oct 27, 2024 6:16 pm Post subject: |
|
|
bstaletic wrote: | emerge -u python:3.11 should do the trick. |
emerge --norepalce should have done the trick. There's no need to recompile something that's already there.
Best Regards,
Georgi |
|
Back to top |
|
|
|