Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
python update 2.7 --> 3.2
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
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2408
Location: Edmonton, AB

PostPosted: Sat Apr 28, 2012 5:09 pm    Post subject: python update 2.7 --> 3.2 Reply with quote

Am I looking for problems updating python directly from 2.7 to 3.2 ?

If I'm not mistaken the steps are:
Code:
eselect python set python3.2
python-updater
emerge --depclean
revdep-rebuild

_________________
#Joseph
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 32338
Location: 56N 3W

PostPosted: Sat Apr 28, 2012 5:16 pm    Post subject: Reply with quote

Joseph_sys,

Python is slotted. You are supposed to have both versions.

The world is not yet ready to have python-3.2 set as the defualt python. If you really want to do that the eselect step is adequate.

When your system breaks, you can keep all the pieces. You will want to get get back to python-2.7 quickly too.
If you do intend to remove it. quickpkg it first, so you can reinstall it quickly with emerge -K
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2408
Location: Edmonton, AB

PostPosted: Sat Apr 28, 2012 5:30 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Joseph_sys,

Python is slotted. You are supposed to have both versions.

The world is not yet ready to have python-3.2 set as the default python. If you really want to do that the eselect step is adequate.

When your system breaks, you can keep all the pieces. You will want to get get back to python-2.7 quickly too.
If you do intend to remove it. quickpkg it first, so you can reinstall it quickly with emerge -K


Thanks for advice. The reason I'm asking as that I just reinstall gentoo on one of my older system (waited two long to upgrade).
So I don't want to do it again :-)
I've noticed on stable x86 python3.2 is default so I was thinking it is standard, and I'm still using on my systems 2.7 and python 3.1 and 3.2 are already in the portage.
_________________
#Joseph
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 32338
Location: 56N 3W

PostPosted: Sat Apr 28, 2012 5:39 pm    Post subject: Reply with quote

Joseph_sys,

You should hve both python 3.2 and 2.7 installed and 2.7 should be the system default.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4316

PostPosted: Sat Apr 28, 2012 8:38 pm    Post subject: Reply with quote

NeddySeagoon wrote:
You should hve both python 3.2 and 2.7 installed and 2.7 should be the system default.

Unless you are developing in python and thus want to play with it, there is no reason yet tohave python 3.2 installed. I have package.mask'ed >=python-3 and no problems with this so far.
Back to top
View user's profile Send private message
yngwin
Developer
Developer


Joined: 19 Dec 2002
Posts: 4403
Location: Suzhou, China

PostPosted: Sun Apr 29, 2012 3:47 am    Post subject: Reply with quote

I am with mv. Most users really don't need python-3 and should have it masked. You should only have python 2.7. The rest is unnecessary bloat unless you're doing something specific with it.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
EatMeerkats
Apprentice
Apprentice


Joined: 15 Mar 2006
Posts: 234

PostPosted: Sun Apr 29, 2012 4:04 am    Post subject: Reply with quote

…except the stage 3 install comes with 3.2 as default.
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2727
Location: Hamburg/Germany

PostPosted: Sun Apr 29, 2012 5:57 am    Post subject: Reply with quote

Keep in mind, portage is buggy with python-3.
Back to top
View user's profile Send private message
yngwin
Developer
Developer


Joined: 19 Dec 2002
Posts: 4403
Location: Suzhou, China

PostPosted: Sun Apr 29, 2012 8:43 am    Post subject: Reply with quote

EatMeerkats wrote:
…except the stage 3 install comes with 3.2 as default.

That is indeed unfortunate fallout of the way python-3 was pushed to stable by the previous maintainer.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4316

PostPosted: Sun Apr 29, 2012 8:53 am    Post subject: Reply with quote

yngwin wrote:
That is indeed unfortunate fallout of the way python-3 was pushed to stable by the previous maintainer.

I think that this previous maintainer was correct: Since python-3 is considered stable upstream, there is no reason why Gentoo should hold back the stability: It is not the package's fault if most packages are not using it, currently. It would only be a problem if Gentoo would recommend to switch to python-3 as the system's python which must happen only if no other package has a problem with it.
toralf wrote:
Keep in mind, portage is buggy with python-3

Can you comment on this? I know only that the output of wget was not so nice with python-3 due to a bug of python-3 (I haven't checked recently whether this bug is fixed meanwhile), but I wouldn't call this eyecandy output issue a bug.
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2727
Location: Hamburg/Germany

PostPosted: Sun Apr 29, 2012 1:15 pm    Post subject: Reply with quote

mv wrote:

Can you comment on this? ... eyecandy output issue
Well, I switched for python3 few weeks ago and run into issues (dunno details - sry, dementia) - and a guy in the IRC told me to switch to python2 back.
Back to top
View user's profile Send private message
yngwin
Developer
Developer


Joined: 19 Dec 2002
Posts: 4403
Location: Suzhou, China

PostPosted: Mon Apr 30, 2012 3:50 pm    Post subject: Reply with quote

mv wrote:
It would only be a problem if Gentoo would recommend to switch to python-3 as the system's python which must happen only if no other package has a problem with it.

Currently the stage3 comes with only python-3. It would make more sense to ship it with python-2 only.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
ferreirafm
Guru
Guru


Joined: 28 Jul 2005
Posts: 468
Location: Sao Paulo, Brazil

PostPosted: Thu Sep 27, 2012 3:20 pm    Post subject: Reply with quote

Hi there,
Can I go back and forward from 2.7 to 3.2 without running python updater?
I need to run some scripts with python 3.2 because of some pandas' requirements.
If I forget to turn back to 2.7, what can happen? I mean, is it safe to do that?
Best,
Back to top
View user's profile Send private message
yngwin
Developer
Developer


Joined: 19 Dec 2002
Posts: 4403
Location: Suzhou, China

PostPosted: Tue Oct 02, 2012 7:42 am    Post subject: Reply with quote

If those scripts need python 3.2 then fix them to call python 3.2 like any good citizen:
Code:
#!/usr/bin/env python3.2

instead of a naked python.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
rogerx
n00b
n00b


Joined: 06 Apr 2004
Posts: 70

PostPosted: Thu Nov 29, 2012 9:04 pm    Post subject: Re: python update 2.7 --> 3.2 Reply with quote

For what it's worth, I upgraded to python-3 and used python-updater (rebuilding all package depends) some time ago. I think around early Spring of 2012 with my older x86 Intel systems.

The *only* problem I then saw was with hplip. The hplip package still depends on python-2.7 for the hp-setup to install the binary (scanner) plugin.

I haven't seen any bugs with Portage or emerge. *HOWEVER* I could be blind and the bugs present might be within the package version masking system -- but so far, I see nothing of the sort with a second recent install on a 64 bit Intel default desktop profile install within the past month.

Also, if you do go ahead and install both python-2 and python-3, they coexist pretty well and you only need to issue a "eselect python set 1 or 2" in a shell and the other shells will use the selected version without having to re-login.

Again, no problems except for hplip breaking on python-3. Portage appears completely stable, unless it's hard-coded to use the install python-2.


Previously mentioned packages:

dev-lang/python-2
dev-lang/python-3
app-admin/eselect-python
app-admin/python-updater

And then read-up on the following for porting your old code using 2to3 or 3to2:
http://docs.python.org/dev/howto/pyporting.html

I have limited experience with Python, but have plenty of other programming experience. As far as python-2 code is concerned, there should be a "catch" at the top or embedded within python-3 to fall-back to python-2 when detecting python-2 scripts. Also, an environmental variable could be engineered within python to detect python-2 code if the environmental variable is set.
_________________
Roger
http://rogerx.freeshell.org/
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