View previous topic :: View next topic |
Author |
Message |
thor_n n00b
Joined: 30 Sep 2003 Posts: 40 Location: Slovakia
|
Posted: Fri Nov 07, 2014 12:41 pm Post subject: 3 pythons |
|
|
Why do I need 3 instances of python?
On my system I've got:
dev-lang/python-2.7.7
dev-lang/python-3.3.5-r1
dev-lang/python-3.4.1
Can someone explain? Or point me to some python doc/wiki to get some insight into why there are so many pythons.
Only while ago there were 2 of them (2.7 and 3.3) and now there are 3. What for?
Can I get rid of at least one of those? |
|
Back to top |
|
|
ct85711 Veteran
Joined: 27 Sep 2005 Posts: 1791
|
Posted: Fri Nov 07, 2014 1:35 pm Post subject: |
|
|
well, your safe to remove the 3.4 for now; since support for that is still masked.
I'd love to see us remove 2.7, but that won't be happening for a long time, because too many packages never updated to use python 3 yet. |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Sat Nov 08, 2014 8:41 am Post subject: |
|
|
This has gotten ridiculous indeed. You probably only need python:2.7. I would suggest to remove both 3.3 and 3.4, unless you have a package that hard-depends on them and doesn't work with python:2.7. _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
thor_n n00b
Joined: 30 Sep 2003 Posts: 40 Location: Slovakia
|
Posted: Mon Nov 10, 2014 7:51 am Post subject: |
|
|
But could perhaps someone from python herd mask it for us (riding the stable wave)?
I would manually mask it in my /etc/portage/package.mask then forget about it and when the time comes to update from 2.7 I'd be confused about what's going on. |
|
Back to top |
|
|
ct85711 Veteran
Joined: 27 Sep 2005 Posts: 1791
|
Posted: Mon Nov 10, 2014 1:53 pm Post subject: |
|
|
Honestly, I doubt python 2.7 will be going away any time soon. Sadly, there's several packages that still depend on python 2.7 (they never been updated to work with 3+ yet). The nice part is, even if you forget about it, portage will let you know when it's time to update python. Portage will tell you directly, if a package depends on python-3+. Then there's the usual news update from portage that will more likely mention 2.7 is getting ready to be masked. |
|
Back to top |
|
|
jburns Veteran
Joined: 18 Jan 2007 Posts: 1214 Location: Massachusetts USA
|
Posted: Mon Nov 10, 2014 11:52 pm Post subject: |
|
|
There are packages that depend on python 3. It is also nice to have more than one version of python to handle the case where a python update breaks portage and switching the active version allows portage to work. |
|
Back to top |
|
|
lotuskip n00b
Joined: 24 Aug 2014 Posts: 14
|
Posted: Tue Nov 11, 2014 10:34 am Post subject: |
|
|
Inspired by yngwin's post above, I decided to remove my python3. This lead to strange discoveries that I wish to share. (I'm still new with gentoo and portage, which might show.)
At first, python3 couldn't be removed. The output from emerge baffled me:
Code: |
dev-lang/python-3.3.5-r1 pulled in by:
sys-apps/portage-2.2.8-r2 requires >=dev-lang/python-2.7, >=dev-lang/python-2.7[ssl]
x11-libs/libxcb-1.10 requires >=dev-lang/python-3.3.2-r2:3.3[xml]
|
The portage line makes no sense. It requires python >= 2.7 so it pulls in 3.3? I also failed to understand how libxcb, a C library, came to require python.
In fact it looked like a portage update wanted to pull in a third python for me, too. So I peeked at the USE flags for portage:
Code: |
USE="(ipc) -build -doc -epydoc (-pypy2_0) -python2 -python3 (-selinux) -xattr" ABI_X86="64" LINGUAS="-ru" PYTHON_TARGETS="python2_7 (-pypy2_0) -python2_6 -python3_2 -python3_3 -python3_4"
|
I generally dislike python and have a global "-python" in my make.conf, which might be why you see both -python2 and -python3 there. Apparently this is a problem. I suspect that emerge gets confused by neither python being wanted and in consequence pulls in all possible pythons. Besides "-python" under USE, my make.conf has
Code: |
PYTHON_TARGETS="python2_7"
|
Anyhow, everything was fixed when I added
/etc/portage/package.use: | sys-apps/portage python2 |
and re-emerged portage. Now python-3.3.5 could be removed and apparently, whaddayaknow, libxcb didn't depend on it anymore, either! I sort of feel like I stumbled on a bug.
On a different note,
jburns wrote: | ... handle the case where a python update breaks portage and switching the active version allows portage to work. |
This sounds terrible. Does that happen? Like, regularly? |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Tue Nov 11, 2014 6:27 pm Post subject: |
|
|
lotuskip wrote: | On a different note,
jburns wrote: | ... handle the case where a python update breaks portage and switching the active version allows portage to work. |
This sounds terrible. Does that happen? Like, regularly? |
No; it's never happened to me once (crosses fingers.) But then I automatically rebuild portage whenever python is installed, and have never needed to reinstall python.
There's a PYTHON_SINGLE_TARGET variable as well, btw; it just selects which python you want when a package only works with one. Not that you need it atm, but it might be worth bearing in mind. A good hint is to use portageq to check what's currently in play:
Code: | $ portageq envvar PYTHON_SINGLE_TARGET
python2_7 | as quite often you don't need to set anything specific yourself (and it's better just to follow the tree/profile.) |
|
Back to top |
|
|
jburns Veteran
Joined: 18 Jan 2007 Posts: 1214 Location: Massachusetts USA
|
Posted: Tue Nov 11, 2014 7:48 pm Post subject: |
|
|
The problem with a bad version of python breaking portage happened to me once and there was only a small window of time when the bad version was available
Portage having both -python2 and -python3 means that portage is built for both python2 and python3 if they are both specified in PYTHON_TARGETS. |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Thu Nov 27, 2014 11:49 am Post subject: |
|
|
thor_n wrote: | But could perhaps someone from python herd mask it for us (riding the stable wave)? |
That's not going to happen, because they think python-3 is the bee's knees. _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Thu Nov 27, 2014 11:51 am Post subject: |
|
|
jburns wrote: | It is also nice to have more than one version of python to handle the case where a python update breaks portage and switching the active version allows portage to work. |
I have been using Gentoo since 2002, and have not come across that even once. _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
luismw Tux's lil' helper
Joined: 04 Jan 2010 Posts: 91
|
Posted: Thu Nov 27, 2014 1:12 pm Post subject: |
|
|
Going further: besides having three versions of python, what's up with the recent changes in the default PYTHON_TARGETS?
Last sunday, it was set to Python 3.4, so all the python packages were rebuilt. The next day, after syncing, it went back to Python 3.3, and I have kept from reemerging in the hope that maybe we get back to 3.4. |
|
Back to top |
|
|
Aiken Apprentice
Joined: 22 Jan 2003 Posts: 239 Location: Toowoomba/Australia
|
Posted: Thu Nov 27, 2014 9:35 pm Post subject: |
|
|
luismw wrote: | Going further: besides having three versions of python, what's up with the recent changes in the default PYTHON_TARGETS?
|
I am curious about this as well. The news item regarding the removal of 3.3 has been removed. I also have many computers wanting to reinstall 3.3 after removing it a few days ago. _________________ Beware the grue. |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Fri Nov 28, 2014 11:09 am Post subject: |
|
|
Meh I have to admit I hate the way PYTHON is handled; even more so now that the same "thinking" has been applied to multilib, where I really cannot stand the verbiage. |
|
Back to top |
|
|
tld Veteran
Joined: 09 Dec 2003 Posts: 1816
|
Posted: Sun Nov 30, 2014 4:35 pm Post subject: |
|
|
I was glad to find this thread...python has been annoying the crap out of me lately and I was thinking about starting a thread around the whole thing. I'm not sure I've really ever understood the way it's handled. I have no PYTHON_TARGETS related stuff in my make.conf...does that mean it's determined based on eselect?
Here's what I have:
Code: | eselect python list
Available Python interpreters:
[1] python2.7 *
[2] python3.3
[3] python3.4
eselect python list --python3
Available Python 3 interpreters:
[1] python3.3 *
[2] python3.4 |
I'm assuming that the latter means that, if a package can use python 3 it'll currently use 3.3(??).
In any case, it all seems to be quite a mess. The longest part of my update today was a re-compile of dev-libs/boost (something I'd love to do without itsellf, but I need for app-office/libreoffice-bin). and the recompile was purely because of python:
Code: | [ebuild R ] dev-libs/boost-1.52.0-r7:0/1.52 USE="nls threads -debug -doc -icu -mpi -python -static-libs -tools" PYTHON_TARGETS="python2_7 python3_3 (-python3_2%)" 0 kB
|
I'd love to just can python 3 as well, or at least have just one of them.
Tom |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6051 Location: Removed by Neddy
|
Posted: Sun Nov 30, 2014 6:49 pm Post subject: |
|
|
tld wrote: | I was glad to find this thread...python has been annoying the crap out of me lately and I was thinking about starting a thread around the whole thing. I'm not sure I've really ever understood the way it's handled. I have no PYTHON_TARGETS related stuff in my make.conf...does that mean it's determined based on eselect?
Here's what I have:
Code: | eselect python list
Available Python interpreters:
[1] python2.7 *
[2] python3.3
[3] python3.4
eselect python list --python3
Available Python 3 interpreters:
[1] python3.3 *
[2] python3.4 |
I'm assuming that the latter means that, if a package can use python 3 it'll currently use 3.3(??).
In any case, it all seems to be quite a mess. The longest part of my update today was a re-compile of dev-libs/boost (something I'd love to do without itsellf, but I need for app-office/libreoffice-bin). and the recompile was purely because of python:
Code: | [ebuild R ] dev-libs/boost-1.52.0-r7:0/1.52 USE="nls threads -debug -doc -icu -mpi -python -static-libs -tools" PYTHON_TARGETS="python2_7 python3_3 (-python3_2%)" 0 kB
|
I'd love to just can python 3 as well, or at least have just one of them.
Tom |
for your setup py27 is the default.
If the shebang calls for a py3 then py33 is your default.
it is still a neater solution than binary distro's (renaming the bin, editing the shebang [ note gentoo does rename the python binary from python to python2.7 but at least it is a bit finer than just python2 ...])
Code: |
eselect python list
Available Python interpreters:
[1] python2.7
[2] python3.3 *
[3] python3.4
|
I would like to move over to 34 (as I am using that for my personal stuff) but right now I cant (iirc)
Code: |
cat /etc/portage/package.use/py27
media-gfx/inkscape python_targets_python2_7 python_single_target_python2_7
net-analyzer/ntop python_targets_python2_7 python_single_target_python2_7
media-gfx/gimp python_targets_python2_7 python_single_target_python2_7
app-i18n/ibus python_targets_python2_7 python_single_target_python2_7
dev-vcs/git python_targets_python2_7 python_single_target_python2_7
dev-util/glade python_targets_python2_7 python_single_target_python2_7
media-libs/alsa-lib python_targets_python2_7 python_single_target_python2_7
net-print/cups python_targets_python2_7 python_single_target_python2_7
net-print/hplip python_targets_python2_7 python_single_target_python2_7
gnome-extra/cinnamon python_targets_python2_7 python_single_target_python2_7
dev-libs/gobject-introspection python_targets_python2_7 python_single_target_python2_7
dev-util/itstool python_targets_python2_7 python_single_target_python2_7
sys-libs/talloc python_targets_python2_7 python_single_target_python2_7
media-gfx/graphviz python_targets_python2_7 python_single_target_python2_7
sys-libs/tdb python_targets_python2_7 python_single_target_python2_7
dev-java/antlr python_targets_python2_7 python_single_target_python2_7
net-analyzer/net-snmp python_targets_python2_7 python_single_target_python2_7
sys-libs/tevent python_targets_python2_7 python_single_target_python2_7
app-text/asciidoc python_targets_python2_7 python_single_target_python2_7
app-admin/system-config-printer-gnome python_targets_python2_7 python_single_target_python2_7
app-admin/system-config-printer-common python_targets_python2_7 python_single_target_python2_7
dev-util/gtk-doc python_targets_python2_7 python_single_target_python2_7
dev-libs/libdbusmenu python_targets_python2_7 python_single_target_python2_7
app-emulation/playonlinux python_targets_python2_7 python_single_target_python2_7
|
only 25 packages needing python27 though so not far off _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
|