Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Which Python Versions are Current?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
FR3141
n00b
n00b


Joined: 13 Jan 2018
Posts: 39

PostPosted: Thu Jan 18, 2018 1:04 am    Post subject: Which Python Versions are Current? Reply with quote

Since most of my programming is done with C, Perl, and Bash, I don't pay much attention to the Python installations on my system. But looking at which Python versions are present I find this:

Code:
# eselect python list
Available Python interpreters, in order of preference:
  [1]   python3.6
  [2]   python2.7
  [3]   python3.4
  [4]   python3.5 (fallback)

Do I need all these Python versions? If not, then which ones should I uninstall?

Portage depends on Python as do many other packages but surely I do not need all these different Python versions.

[Moderator edit: added [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Thu Jan 18, 2018 6:52 am    Post subject: Reply with quote

In a stable system the defaults python target are
/usr/portage/profiles/base/make.defaults:
...
# Mike Gilbert <floppym@gentoo.org> (15 May 2012)
# Default target(s) for python-r1.eclass
# Updated to python3_5 on 28 Nov 2017
PYTHON_TARGETS="python2_7 python3_5"
PYTHON_SINGLE_TARGET="python3_5"
...

then in a default installation you should have python2.7 and python3.5.
But if you have installed python3.4 and python3.6 it means that some package require these, you can investigate with eix
Code:
$ eix --installed-with-use python_targets_python3_4
$ eix --installed-with-use python_targets_python3_5
$ eix --installed-with-use python_targets_python3_6

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4554
Location: Germany

PostPosted: Thu Jan 18, 2018 1:25 pm    Post subject: Reply with quote

And please have a look on --depclean
--depclean with --verbose shows the reverse dependencies too.
Code:
emerge -av --depclean dev-lang/python
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Jan 19, 2018 2:08 am    Post subject: Reply with quote

3.4 is obsolete and you can likely dispose of it by updating a few packages.
3.5 is the default and should be there, it's possible to run a 3.6-only system but that requires effort. You probably shouldn't have both those at the same time.
Leave 2.7 alone, you can't get rid of that.
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Fri Jan 19, 2018 4:25 am    Post subject: Reply with quote

Use some other tool to see of those versions of python are installed. I used equery l python

Have found the list of pythons listed by eselect python list is a list of pythons that have been installed at some point and not a list of pythons that are currently installed. It is read from /etc/python-exec/python-exec.conf and it looks like when a python is removed is is not removed from that list. Which makes it confusing.

Not quite game to put money on it but I am finding it easy to think you do not have 3.4 installed. As for 3.5 and 3.6 both have been automatically pulled on as dependencies for me with 3.5 as the main version.
_________________
Beware the grue.
Back to top
View user's profile Send private message
FR3141
n00b
n00b


Joined: 13 Jan 2018
Posts: 39

PostPosted: Sat Jan 20, 2018 3:02 am    Post subject: Reply with quote

fedeliallalinea wrote:
In a stable system the defaults python target are
PYTHON_TARGETS="python2_7 python3_5"
PYTHON_SINGLE_TARGET="python3_5"


I suppose that this was my problem. I had neither of these variables set.

After setting both in make.conf I did "emerge -pv --changed-use world" which rebuilt a few packages that used python versions other than 2_7 and 3_5. Then I unmerged all python versions other than 2_7 and 3_5.

Thanks to all the helpful advice.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Sat Jan 20, 2018 11:27 am    Post subject: Reply with quote

FR3141 wrote:
I suppose that this was my problem. I had neither of these variables set.

These are provided by profile /usr/portage/profiles/base/make.defaults, try to see with emerge --info
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
FR3141
n00b
n00b


Joined: 13 Jan 2018
Posts: 39

PostPosted: Sat Jan 20, 2018 3:02 pm    Post subject: Reply with quote

fedeliallalinea wrote:
These are provided by profile /usr/portage/profiles/base/make.defaults


Yes, I checked make.defaults and those variables are set there, but for some reason other versions of python were still being pulled in.

Anyway, I think I've straightened things out. I'll keep watch over future builds.

Also, how can I keep informed about future changes to the default python installations? Is there a Gentoo web page that tracks python issues?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Sat Jan 20, 2018 4:10 pm    Post subject: Reply with quote

FR3141 wrote:
Also, how can I keep informed about future changes to the default python installations?

If you use -U option on world update you can see that python_targets change

FR3141 wrote:
Is there a Gentoo web page that tracks python issues?

https://bugs.gentoo.org/
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Sat Jan 20, 2018 5:23 pm    Post subject: Reply with quote

To be clear, if you set those in make.conf, then future changes to those variables in the profile will be ignored in deference of your local setting. This may or may not be what you want, depending on whether you want to support freezing a system with these versions. Most users will not be frozen, and will eventually move on to newer Python versions. I would leave those unset in make.conf.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum