Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[solved] Current Python Version Selection

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
jagdpanther
l33t
l33t
Posts: 820
Joined: Sat Nov 22, 2003 2:26 pm

[solved] Current Python Version Selection

  • Quote

Post by jagdpanther » Wed Oct 23, 2024 1:35 am

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: Select all

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.
Top
bstaletic
Guru
Guru
Posts: 517
Joined: Sat Apr 05, 2014 5:46 pm

  • Quote

Post by bstaletic » Wed Oct 23, 2024 2:30 am

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.
Top
jagdpanther
l33t
l33t
Posts: 820
Joined: Sat Nov 22, 2003 2:26 pm

  • Quote

Post by jagdpanther » Wed Oct 23, 2024 2:44 am

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.)
Top
jagdpanther
l33t
l33t
Posts: 820
Joined: Sat Nov 22, 2003 2:26 pm

  • Quote

Post by jagdpanther » Sun Oct 27, 2024 6:01 pm

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: Select all

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: Select all

#!/usr/bin/env python3
With all lines commented out in python-exec.conf I get:

Code: Select all

$ 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: Select all

python3.12
python3.13
python3.11
Which fixes the issue and now have:

Code: Select all

$ 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?
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3537
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sun Oct 27, 2024 6:16 pm

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
Top
Post Reply

5 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic