LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-23-2017, 09:59 PM   #1
hedron
Member
 
Registered: Jul 2009
Location: NYC
Distribution: Slackware64-multilib 15.0, SARPI, artix
Posts: 401

Rep: Reputation: 32
Is Python 3 going to be default anytime soon?


I'm just curious if there is any chance it's going to be implemented in 14.3 or so. I guess I can always do python3, but that's annoying. I would be content to just delete python 2 from Slackware altogether, but a few odd things depend on it.
 
Old 02-23-2017, 11:49 PM   #2
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Arch has gone through great lengths to make python3 default. The result is now you can not run arch without python2 and python3, look at the required by list for their python2 pkgbuild.

https://www.archlinux.org/packages/extra/i686/python2/
 
Old 02-24-2017, 12:20 AM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Python 2 has 4 years before it's EOL. So I suspect that it will be default for at least a couple more Slackware versions.
 
Old 02-24-2017, 12:40 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,570
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
Doesn't Xorg need Python-2?
 
Old 02-24-2017, 04:42 AM   #5
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Yes and so does Mesa last I remember.
 
Old 02-24-2017, 09:48 AM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
To be fair, I'm pretty sure hedron just meant the /usr/bin/python executable being Python 3.

Not necessarily Python 2 being removed from Slackware.

Last edited by dugan; 02-24-2017 at 02:53 PM. Reason: Added missing executable
 
1 members found this post helpful.
Old 02-24-2017, 10:00 AM   #7
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
If Arch couldn't re-write enough code to chase python2 off the nodes, I don't know of anybody who's going to be able to do it.
You've got "six" for compatibility between 2.5 and 3.0, so you could write it in 3, deploy it in a virtual 2.7 environment and require the six module. That's basically how ansible handles the problem of portability vs the unforgivable sin of writing in the only programming language, besides c and perl, you can guarantee is on the node.

Last edited by dijetlo; 02-24-2017 at 10:01 AM.
 
Old 02-24-2017, 02:42 PM   #8
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Quote:
Originally Posted by dugan View Post
To be fair, I'm pretty sure hedron just meant the /usr/bin executable being Python 3.

Not necessarily Python 2 being removed from Slackware.
Quote:
Originally Posted by hedron View Post
I would be content to just delete python 2 from Slackware altogether, but a few odd things depend on it.
It reads differently to me...
 
Old 02-24-2017, 02:57 PM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by dijetlo View Post
If Arch couldn't re-write enough code to chase python2 off the nodes, I don't know of anybody who's going to be able to do it.
Arch didn't rewrite anything. They just made decisions about what to package.

Same as what Fedora's doing.
 
Old 02-24-2017, 05:23 PM   #10
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
Arch didn't rewrite anything. They just made decisions about what to package.
What you package isn't the problem, I have 2.7 and 3.4 side by side, It's the "python pointer" in /usr/bin that determines the default python version for most scripts
Quote:
bash-4.3# ls -alh /usr/bin/python
lrwxrwxrwx 1 root root 9 Dec 19 18:48 /usr/bin/python -> python2.7
I'm not sure how arch finally got it resolved, probably ran a sed through their software stack replacing "#!/usr/bin/python" && "#!/usr/bin/env python" with " /usr/bin/python2"
This works, for example
Code:
#!/usr/bin/python2
print "hello from the Stone Age!!!"
Then you could turn the pointer without downing the node. (it's not just 2 subsystem that rely on it, run a recursive strings from the root dir and grep the output for those two references, you'll realize it's almost everywhere.)
But it's not much use to us, mountains of python2 script is still being produced, and if arch and fedora are the only distros who'll turn the thing, there always will be mountains of commercial script referencing the python pointer as python2 since you'd have every expectation that's how it's set up on a commercial node.

Most python programmers working in automation don't care what version of python is on the node, as long as the "virtualenv" module is in site-packages or we can pip it down. With that, you can write in whatever python version you prefer (assuming it's in an accessible pip repo), just remember to erase the virtualenv when you're done.
Perhaps that's part of why the python community isn't really that wound up about it and therefor why the migration to python3 as the standard has been so gradual.

Last edited by dijetlo; 02-24-2017 at 06:29 PM.
 
1 members found this post helpful.
Old 02-24-2017, 06:29 PM   #11
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
I'm not sure how arch finally got it resolved, probably ran a sed through their software stack replacing "#!/usr/bin/python" && "#!/usr/bin/env python" with " /usr/bin/python2"
That is indeed done during packaging, by the standard build system used by Python's packages:

Code:
/usr/bin/python2 setup.py install
That sets the script shebangs.

Last edited by dugan; 02-24-2017 at 06:36 PM.
 
Old 02-24-2017, 06:39 PM   #12
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
/usr/bin/python2 setup.py install
I wouldn't be averse if our BDFL & Team chose that route, I think the python3 guys did an outstanding job and I feel a little sorry for them that their work isn't being fully leveraged. Our Slackbuild scripts could be modified to accommodate the issues surrounding package installation, I notice Arch has a bash hack to handle the problem. Unsurprisingly, we're well positioned to handle something like that since we use build scripts instead of a more comprehensive solution (which would no doubt bite us in the hind parts if we tried this).

Of course, we'd all have to swear a solemn oath to answer 100 desktop support questions on this board every week until the fires burned out, but I'm game.

Arch, Fedora, Slackware ... we could be in worse company. They might even stop calling us luddites...

EDIT: We'd have to make "/usr/bin/python2" a pointer to the default installed python2 version (2.7) or you couldn't safely run python2.7 and python2.11 in /usr/bin. (which is sometimes...needful)

Last edited by dijetlo; 02-24-2017 at 06:59 PM.
 
Old 02-24-2017, 07:15 PM   #13
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
I'm of the opinion that installing python3 as /usr/bin/python is a mistake. If/when they ever get around to another incompatible python version such as python4, or 5 or 6, we'll just end up in the same ambiguous situation. IMO, when python2 is retired, /usr/bin/python should go with it, and python3 should remain /usr/bin/python3 in perpetuity. That way everyone knows exactly what they're getting when they invoke it.
 
4 members found this post helpful.
Old 02-24-2017, 07:29 PM   #14
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by GazL View Post
I'm of the opinion that installing python3 as /usr/bin/python is a mistake. If/when they ever get around to another incompatible python version such as python4, or 5 or 6, we'll just end up in the same ambiguous situation. IMO, when python2 is retired, /usr/bin/python should go with it, and python3 should remain /usr/bin/python3 in perpetuity. That way everyone knows exactly what they're getting when they invoke it.
I'd be fine with this.
 
Old 02-24-2017, 07:52 PM   #15
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
I'm of the opinion that installing python3 as /usr/bin/python is a mistake.
I haven't had any trouble with it GAZL, however I haven't converted a Slackware node to run on python3 as a default, though it's getting mighty tempting....

EDIT: Sorry, misunderstood your intent here.
What if we didn't have a default python version? We modified the build scripts and packages to explicitly point to the appropriate python framework? Would that address your concerns?

Quote:
python version such as python4, or 5 or 6, we'll just end up in the same ambiguous situation.
Python 2 has been around a decade and nobodies found a way to kill it. I'd suspect python3 will have the same lifespan since python rides directly on C++ libraries, so you don't normally see a major revision in python unless you see a major revision in C.
I don't think the main distro would have an issue handling it, I think the repos (slackbuilds/alienBobs/rworkman/et al) would have to sign on to the effort.

Quote:
That way everyone knows exactly what they're getting when they invoke it.
In my experience the world splits cleanly into two groups. Those that don't know they're using python and those that have to code the python. The latter cares, the former doesn't. If you don't fit into that mold then that's certainly a reason NOT to make it required. It's Slackware, so it's all about choices.
We could maintain two parallel build systems but it's going to make maintenance more problematic. Maybe some of these young zealots could volunteer their skills and time to assist in the process, help build the community instead of sitting on the outside wondering why we don't listen to them (because seriously, they have a valid point, tomorrows coming, you can be prepared for it or a victim of it, there is no third option I'm aware of other than death and honestly, I think I'd rather get ready for it than hope for that).

Once upon a time, when big iron ruled the digital world, I can distinctly remember thinking... what's wrong with these ancient turds? Don't they realize technology is rocketing forward? Look at the improvements we've made in the mainframe job queue!!! I don't think I'm ready to be an ancient turd (though the calendar tells me otherwise)

Last edited by dijetlo; 02-24-2017 at 08:49 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set Emacs default for Python output blastradius Programming 1 03-15-2013 03:44 PM
python 2.7 anytime? metageek Slackware 8 03-05-2011 01:31 PM
[SOLVED] where is default python set? splintercdo Slackware 4 02-14-2011 01:27 PM
Change default Python version rocka Debian 13 03-31-2009 05:26 PM
Alsa 1.0.6 anytime? jeru Debian 1 08-22-2004 03:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration