hippy
Posts: 6107
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Emergency Action Required by RPi Foundation

Mon Jun 03, 2019 9:43 am

paddyg wrote:
Sun Jun 02, 2019 12:43 pm
A non-negligible proportion of questions I've answered on this forum and elsewhere have had the python 2v3 installation as root cause.
I am not convinced there have been that many problems. I don't see the proposed change making things any worse, only improving things.

Code: Select all

    Current         Stop-gap         Long term

"python"  -> 2   "python"  -> ?   "python"  -> 3
"python2" -> 2   "python2" -> 2   "python2" -> 2
"python3" -> 3   "python3" -> 3   "python3" -> 3
At present the only reported issue should be Python 3 novices with "I type "python" and it won't run my Python 3 code". The answer is "You must type python3, make sure your codebase shebangs specify python3".

During the stop-gap period it does depend how that stop-gap is implemented. But the answer for Python 3 users is probably the same, and for Python 2 users it will likely be "Python 2 is deprecated, get used to typing "python2", update your codebase shebangs, or move to using Python 3".

Long term it will be any lingering Python 2 users complaining "I type "python" and it won't run my Python 2 code". The answer becomes "You need to install Python 2 and then type "python2", update your codebase shebangs, or move to using Python 3".

So Python 3 users shouldn't be any worse off, and long term shouldn't have any issues, no matter what they are typing.

Python 2 users will become the ones with problems but they should be declining in number as time goes on.

A global issue arises when some systems have moved to "python" defaulting to 3 while others still default to 2. There's not much anyone can do about that but it's no worse than most systems having moved to systemd while some haven't.

If Raspbian is tracking Debian then it will be those other system's problem if typing "python" doesn't launch Python 3, not Raspbian's.

hippy
Posts: 6107
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Emergency Action Required by RPi Foundation

Mon Jun 03, 2019 10:18 am

paddyg wrote:
Sat Jun 01, 2019 2:15 pm
Debian, for some reason, took the decision to make python mean python2 but I think the Pi Foundation could take the initiative and push back against that lunacy.
Debian undoubtedly made "python" point to Python 2 because there was no Python 3 at the time, "Python" was "Python 2", so hardly "lunacy".

What did not happen is "python" changing to point to Python 3 when that did arrive. It can be argued they should have made that change, but it is not surprising they did not, it would have caused no end of problems if they had done. Much of the Python code used by Debian would have stopped working overnight; Debian would have likely 'broken itself'.

Things haven't changed yet because Debian would still likely have 'broken itself' if they had, as would Raspbian if it tried to make that change itself. Long term things will change and it will inevitably happen when Debian won't 'break itself' in making that change.

When Debian changes so too will Raspbian. There is potential for that change breaking Raspbian but one must assume Raspbian is on top of that or hope things will get quickly resolved. Raspbian can be ahead of the game for Raspbian specific code, probably will be, but jumping ahead of Debian changes is a lot of work and effort.

The issue boils down to Python 3 being different to Python 2, not a backwards compatible latest version of the same thing. Debian had no control over that. They were not the ones who created the mess that decision has brought about.

ankith26
Posts: 103
Joined: Mon Mar 25, 2019 11:08 am
Location: Earth
Contact: Website

Re: Emergency Action Required by RPi Foundation

Sat Jun 08, 2019 6:02 am

An interesting observation, I just used pip install and got this interesting warning
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
My website is at https://pratt.ml
Hope it runs (which it wont)

User avatar
ben_nuttall
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 231
Joined: Sun Aug 19, 2012 11:19 am
Location: Cambridge, UK
Contact: Website

Re: Emergency Action Required by RPi Foundation

Sat Jun 08, 2019 1:47 pm

https://www.python.org/dev/peps/pep-0394/

This PEP states that `python` should not point to Python 3.

Raspbian follows Debian. Debian decide what's in each release, what's supported and what's not. Debian Buster is due out soon, and they decided to keep Python 2.7 in the repo. That means they'll support it beyond the upstream (Python itself) EOL of 1/1/2020. But I assume the next Debian release will completely drop it.

All of RPF's learning resources (online projects, video courses, programmes, etc) use and recommend Python 3.
Community Manager - Raspberry Pi Foundation
Author of GPIO Zero and creator of piwheels

User avatar
bensimmo
Posts: 4184
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Emergency Action Required by RPi Foundation

Sat Jun 08, 2019 5:08 pm

Ben, how's piwheels doing for 3.6/3.7 whichever ends up in Buster? (3.7 if it follows my RPDx86 "buster" test).
Is it all setup and ready?
I remember reading you were getting it ready, but haven't check to see how far you got.

hippy
Posts: 6107
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Emergency Action Required by RPi Foundation

Sat Jun 08, 2019 9:09 pm

ben_nuttall wrote:
Sat Jun 08, 2019 1:47 pm
This PEP states that `python` should not point to Python 3.
For now, yes, but the migration notes do acknowledge that "python" will, when provided, at some point in the future, invoke something other than Python 2 'as a user convenience'.

The issue really boils down to "What should "python" invoke?" And the answer seems to be it should be Python 2 until some time after Python 2 goes EOL ( but that's only a recommendation, and some have already ignored it ).

And, in the meantime, Python programmers should sort their shebangs out to be explicitly "python2" or "python3", and only use "python" when fully compatible with both.

User avatar
ben_nuttall
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 231
Joined: Sun Aug 19, 2012 11:19 am
Location: Cambridge, UK
Contact: Website

Re: Emergency Action Required by RPi Foundation

Sun Jun 09, 2019 1:19 am

bensimmo wrote:
Sat Jun 08, 2019 5:08 pm
Ben, how's piwheels doing for 3.6/3.7 whichever ends up in Buster? (3.7 if it follows my RPDx86 "buster" test).
Is it all setup and ready?
I remember reading you were getting it ready, but haven't check to see how far you got.
Working on it! Will just be 3.7, not 3.6.
Community Manager - Raspberry Pi Foundation
Author of GPIO Zero and creator of piwheels

Return to “Python”