Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Python versions and eselect
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
paradigm-X
Apprentice
Apprentice


Joined: 19 Sep 2013
Posts: 168

PostPosted: Thu Jan 09, 2014 9:42 pm    Post subject: Python versions and eselect Reply with quote

I am not a programmer, and I can't say I understand much about why I need two versions of Python on my Gentoo OS, but I can live with it if need be. Even so, I am puzzled about something that has come up in connection with the version and portage. When I do this:

eselect python list

I see this:

Available Python Interpreters
python 2.7
python 3.2
python 3.3 *

So, I believe that I have the last one selected as my preferred interpreter. Nevertheless, I do have both python 2.7 and python 3.3 installed, as I can see when I do this: eix python. All this duplication leads me to wonder what I should do in the case of building Qemu because I can see among the many USE flags available to portage with it is both of these:

"python" Add optional support/bindings for the Python language
"python_targets_python2.7" Build with Python 2.7

As it is right now, I have Qemu built with a USE flag for the latter of these two only. Lacking the first one as a USE flag, am I missing some sort of functionality, which I may need and presume to be enabled? Should I re-emerge Qemu with both of these flags, among the others I used with it already?
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Fri Jan 10, 2014 2:19 am    Post subject: Reply with quote

While applications are gradually updated from python2 to python3 (which will take years in some cases), users are likely to need both python3 and python2.

Take a look at the various actions and options for a given eselect module by simply typing 'eselect <modulename>'. In the case of eselect python, you see:
Code:
 ~ # eselect python
Usage: eselect python <action> <options>

Standard actions:
  help                      Display help text
  usage                     Display usage information
  version                   Display version information

Extra actions:
  list                      List installed Python interpreters
    --python2                 List installed Python 2 interpreters
    --python3                 List installed Python 3 interpreters
  set <target>              Set main active Python interpreter
    --python2                 Set active Python 2 interpreter without setting of main active Python interpreter if it is not set to Python 2
    --python3                 Set active Python 3 interpreter without setting of main active Python interpreter if it is not set to Python 3
  show                      Show main active Python interpreter
    --ABI                     Show Python ABI in format of PYTHON_ABI variable
    --python2                 Show active Python 2 interpreter
    --python3                 Show active Python 3 interpreter
  update                    Switch to the most recent CPython interpreter
    --if-unset                Do not override existing implementation
    --ignore SLOT             Ignore SLOT when setting symlinks
    --python2                 Set active Python 2 interpreter without setting of main active Python interpreter if it is not set to Python 2
    --python3                 Set active Python 3 interpreter without setting of main active Python interpreter if it is not set to Python 3



From this, you can see that you can control which version of python is your "main" interpreter. You can also see that you can perform each of the actions (list, set, show, and update) specifically for python2 or python3. (It is possible to have multiple versions of each installed).
Back to top
View user's profile Send private message
Angrychile
Apprentice
Apprentice


Joined: 27 Oct 2009
Posts: 235

PostPosted: Fri Jan 10, 2014 3:31 am    Post subject: Re: Python versions and eselect Reply with quote

paradigm-X wrote:
[...]am I missing some sort of functionality, which I may need and presume to be enabled? Should I re-emerge Qemu with both of these flags, among the others I used with it already?


It of course depends on the package, but for the most part, you won't miss out on much. This whole "double dance" is a pain for developers, but I don't think it really has any impact on users.
_________________
hola
Back to top
View user's profile Send private message
paradigm-X
Apprentice
Apprentice


Joined: 19 Sep 2013
Posts: 168

PostPosted: Fri Jan 10, 2014 4:42 pm    Post subject: Reply with quote

> "...for the most part, you won't miss out on much. "

Got it. Thanks, Angrychile. Now I can sleep better at night. :O
Back to top
View user's profile Send private message
paradigm-X
Apprentice
Apprentice


Joined: 19 Sep 2013
Posts: 168

PostPosted: Fri Jan 10, 2014 4:52 pm    Post subject: Reply with quote

> " ...You can also see that you can perform each of the actions (list, set, show, and update) specifically for python2 or python3.

Thanks for the good explanation. What is the difference between 'list' and 'show'. I suppose I could just try them both out, but I would prefer not to alter something inadvertently, only to find out about it later when something was broken!

Also, how does one best go about changing all the existing programs on a system after updating from, say, python 3.2 to python 3.3, or is it even necessary? Does running python-update go through all these programs to check for python usage, as such a procedure seems as though it could take quite a while?
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Sat Jan 11, 2014 2:15 am    Post subject: Reply with quote

Generally speaking, 'eselect <module> show' will show what is currently set, while 'eselect <module> list' will list your alternatives.

I think some ebuilds may update these settings, but it's generally a good idea to check it anyway after updating anything there's an eselect module for.

I don't believe python-updater touches these settings. What it does is find and rebuild packages that may have been broken by you having changed which version of python you are using.

See the man pages for eselect and python-updater.
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