Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Upgrading Python 3.4 to 3.5 using PYTHON_TARGETS [SOLVED]
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
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 25

PostPosted: Sat Nov 25, 2017 2:44 pm    Post subject: Upgrading Python 3.4 to 3.5 using PYTHON_TARGETS [SOLVED] Reply with quote

I noticed that python-updater will be removed and that PYTHON_TARGETS (and PYTHON_SINGLE_TARGET?) and emerge --newuse world should be used instead. Since both Python 3.4 and 3.5 are now stable, I thought this would be a good time to try to use this new update method. However, the Gentoo Python wiki doesn't contain the string "target" (or "python-updater", for that matter).

So I just tried. I updated my make.conf (just after doing an emerge --newuse --deep), replacing python3_4 with python3_5 so that it now looks like:
Code:
PYTHON_TARGETS="python2_7 python3_5"
PYTHON_SINGLE_TARGET="python3_5"

and ran emerge --newuse world with and without --deep. I get a list of ~150-200 packages that need to be merged, but also ~30 screenfulls of slot conflicts (~1500-2000 lines according to wc -l). If I add --nodeps, I get no blocks, but only ~50 packages will be merged. My emerge --info can be found here.

What am I doing wrong? Is there any harm in updating the first 50 packages (I suppose using --nodeps is a liability)? I'd rather not wreck portage... :wink: Thanks in advance for your help!


Last edited by AstroFloyd on Sat Nov 25, 2017 4:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 20123
Location: here

PostPosted: Sat Nov 25, 2017 2:55 pm    Post subject: Reply with quote

You can post output of command emerge? In my system no conflict problems with python3.5
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 25

PostPosted: Sat Nov 25, 2017 3:12 pm    Post subject: Reply with quote

fedeliallalinea wrote:
You can post output of command emerge? In my system no conflict problems with python3.5

Yes, I pasted the outpout of emerge --ask --update --changed-use world here. It's LOOOONG though :wink:
Oh, I noticed just now that I forgot to specify --backtrack, but the result is the same (or similar) with --backtrack=99.
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 20123
Location: here

PostPosted: Sat Nov 25, 2017 3:29 pm    Post subject: Reply with quote

AstroFloyd wrote:
Yes, I pasted the outpout of emerge --ask --update --changed-use world here. It's LOOOONG though :wink:
Oh, I noticed just now that I forgot to specify --backtrack, but the result is the same (or similar) with --backtrack=99.

Usa a higher backtrack and use also deep option
Code:
# emerge -auDN @world --backtrack=300

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


Joined: 18 Oct 2011
Posts: 25

PostPosted: Sat Nov 25, 2017 4:14 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Code:
# emerge -auDN @world --backtrack=300

That seems to fix it - thank you very much for your time!

If I had been sure that updating PYTHON_TARGETS and PYTHON_SINGLE_TARGET and running emerge -auDN @world was the correct way to go I'd probably have succeeded myself without bothering others. Shouldn't such basic info be in the Wiki?
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 20123
Location: here

PostPosted: Sat Nov 25, 2017 4:22 pm    Post subject: Reply with quote

AstroFloyd wrote:
Shouldn't such basic info be in the Wiki?

Probably yes and you can expand wiki page, indeed in the related page there is message "This article is a stub. You can help by expanding it." :wink:
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 25

PostPosted: Sat Nov 25, 2017 5:31 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Probably yes and you can expand wiki page, indeed in the related page there is message "This article is a stub. You can help by expanding it." :wink:
Sure, I just feel slightly uncomfortable parrotting stuff I've just learnt, but I added a new Section to that page. I would appreciate it if anyone would check it though. :)

One more question - is the eselect python command obsolete now that these variables are used, or should they also be maintained? I suppose it also sets the /usr/bin/python symlink. But what happens if I choose 3.4 using one method and 3.5 using the other?
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 20123
Location: here

PostPosted: Sat Nov 25, 2017 6:12 pm    Post subject: Reply with quote

AstroFloyd wrote:
One more question - is the eselect python command obsolete now that these variables are used, or should they also be maintained? I suppose it also sets the /usr/bin/python symlink. But what happens if I choose 3.4 using one method and 3.5 using the other?

I don't think that eselect command for python is obsolete.
It's not the symlink of eselect that determines what python version is needed to execute a program, but this is provided by python-exec
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 25

PostPosted: Sun Nov 26, 2017 6:06 pm    Post subject: Reply with quote

While upgrading all packages, I ran into
Code:
      Traceback (most recent call last):
        File "setup.py", line 4, in <module>
          import pkg_resources
      ImportError: No module named 'pkg_resources'

after which nothing could continue. I could solve this with
Code:
emerge -aO1 dev-python/setuptools dev-python/certifi

and running the deep new-use @world update again.
Back to top
View user's profile Send private message
radio_flyer
Apprentice
Apprentice


Joined: 04 Nov 2004
Posts: 254
Location: Northern California

PostPosted: Wed Nov 29, 2017 6:10 pm    Post subject: Reply with quote

Although I see the OP is solved, a quick FYI for others new to Gentoo who may stumble on a python upgrade:

I find that I don't need the PYTHON_... flags in make.conf on my stable amd64 system. Portage will upgrade python just fine without them.

HOWEVER, I always run into blockers when this upgrade happens, and that's almost invariably because there is some stable package on my system that is stuck on the old python version/revision. In my case, that package is always media-gfx/blender. In this case, the best course of action is to let out a long sigh, unmerge the stable blender, and then proceed with the upgrade. Because I like my doc USE flag there is typically half-a-dozen python packages I have to temporarily mask with -doc to prevent circular dependencies (due to some packages broken use of python's documentation system), and then portage will upgrade my system just fine to the next python release with no blocks and no issues. I then revert the -doc masks and rebuild those.

Then, I let out another sigh and begin the long, horrible process of trying to build an unstable media-gfx/blender that uses the now-current version of python.

Long story short, if it looks like portage wants to update the current version of python and there are blockers galore, look first to see if there's a package on your system that requires a particular python version/revision. Sooner, rather than later, you'll have to update that package anyway. Blindly following the portage blockage-resolver recommendations will just lead you down a twisty maze with no end.
Back to top
View user's profile Send private message
Chain
Tux's lil' helper
Tux's lil' helper


Joined: 17 Apr 2006
Posts: 110
Location: Vienna

PostPosted: Thu Nov 30, 2017 10:52 am    Post subject: Reply with quote

Code:
emerge -auDN @world --backtrack=300


worked for me too. After removing blender - and openshot.

So maybe it will be of use for someone :)
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5327

PostPosted: Thu Nov 30, 2017 4:50 pm    Post subject: Reply with quote

I'm doing a similar thing but going straight to python 3.6 where possible.

I've got a package.use/python.conf file that starts by removing everything then adding exceptions (3.6 where possible, else 2.7):
Code:
*/* -python PYTHON_SINGLE_TARGET: -* PYTHON_TARGETS: -*

app-text/asciidoc PYTHON_SINGLE_TARGET: python2_7 PYTHON_TARGETS: python2_7
dev-java/javatoolkit PYTHON_TARGETS: python2_7
dev-util/scons PYTHON_TARGETS: python2_7
dev-util/systemtap PYTHON_TARGETS: python2_7
gnome-base/gconf PYTHON_TARGETS: python2_7
media-video/mpv PYTHON_TARGETS: python2_7
net-proxy/http-replicator PYTHON_TARGETS: python2_7
...


One thing I've noticed going through the blockers is there's so many packages that declare a PYTHON_TARGETS="python2_7" and then put it in REQUIRED_USE. If you're not allowed to turn it off, why make it an option at all?
Back to top
View user's profile Send private message
cyberhoffman
n00b
n00b


Joined: 30 Apr 2016
Posts: 29

PostPosted: Thu Nov 30, 2017 7:30 pm    Post subject: Re: Upgrading Python 3.4 to 3.5 using PYTHON_TARGETS [SOLVED Reply with quote

After adding these strings to my /etc/portage/make.conf
AstroFloyd wrote:

Code:
PYTHON_TARGETS="python2_7 python3_5"
PYTHON_SINGLE_TARGET="python3_5"

and issuing
Code:

emerge -vuND --with-bdeps=y world

my system has been updated (including openshot) without any error.
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 20123
Location: here

PostPosted: Fri Dec 01, 2017 6:45 am    Post subject: Re: Upgrading Python 3.4 to 3.5 using PYTHON_TARGETS [SOLVED Reply with quote

cyberhoffman wrote:
After adding these strings to my /etc/portage/make.conf
AstroFloyd wrote:

Code:
PYTHON_TARGETS="python2_7 python3_5"
PYTHON_SINGLE_TARGET="python3_5"

These are provided by profile, you can omit
/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"
...

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


Joined: 02 Sep 2004
Posts: 2490
Location: Canada

PostPosted: Fri Dec 01, 2017 7:08 am    Post subject: Reply with quote

I found that similar problem in my case comes from setuptools being installed with PYTHON_TARGETS python2_7 python3_5 -python3_4 during the update, i.e python3.4 support was getting switched off while some packages were still needing it.

For me it help to reinstall setuptools explicitly supporting both version of python3, i.e I run

$ PYTHON_TARGETS="python2_7 python3_4 python3_5" emerge --oneshot setuptools

and then blocks disappeared (reinstalling setuptools autamatically reinstalled certiffi with the same flags)
Back to top
View user's profile Send private message
cyberhoffman
n00b
n00b


Joined: 30 Apr 2016
Posts: 29

PostPosted: Fri Dec 01, 2017 2:37 pm    Post subject: Re: Upgrading Python 3.4 to 3.5 using PYTHON_TARGETS [SOLVED Reply with quote

fedeliallalinea wrote:

These are provided by profile, you can omit

Thank you.
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