r/Python • • Apr 30 '18

xkcd: Python Environment

Post image
2.4k Upvotes

388 comments sorted by

View all comments

Show parent comments

63

u/origin415 Apr 30 '18

Conda does this but doesn't have all PyPI packages. Also, occasionally you have things that assume that python references the system installed Python 2 rather than your default conda env. Way better than anything else I've seen though.

27

u/Tweak_Imp Apr 30 '18

Why are so many people still on older versions of python? I can see why it doesnt just update itself (for commercial python use for example), but Python 2.7.0 was released on July 3rd, 2010... 8 years ago. Isnt an update to a higher version with the update of the code not worth it?

16

u/origin415 Apr 30 '18

It's a lot of code to update. Most open source libraries are compatible with python 3 but a lot of companies aren't willing to migrate entire codebases internally. Also, as far as programs assuming you have Python 2 in your path, that's because OSX and most Linux distributions have it that way and very few have python 3.

-31

u/khne522 Apr 30 '18
  • Stop using RedHat.

  • Stop using Amazon Linux.

  • macOS… not even once, even if it isn't that hard.

  • Have fun with some old versions of Fedora, Ubuntu, etc.

If you must use these, use pyenv to properly install Python… to some hidden directory.

26

u/lojic Apr 30 '18

Stop using red hat? You just lost all enterprise customers of your code.

-1

u/khne522 Apr 30 '18

Red Hat Python's pip has been broken for ages. Is there even any Python code there?

2

u/[deleted] Apr 30 '18

Anaconda (the Red hat installer) as well as a ton of other redhat tools are based on Python.

1

u/khne522 May 03 '18

That doesn't mean that they didn't break pip last I checked. Same with Amazon Linux.

1

u/HannasAnarion May 01 '18

pip install --update pip

Also, isn't this whole thread about how you shouldn't be relying on system python binaries? Use venv or conda.

1

u/khne522 May 03 '18

venv is for library isolation, not Python binary isolation. You must mean pyenv, whereas conda is as a whole other ecosystem.

-26

u/[deleted] Apr 30 '18

And nothing of value was lost. Enterprise customers are what's wrong with software. Resistance to change in an industry that is predicated on change is a problem.

12

u/Rostin Apr 30 '18 edited Apr 30 '18

I assume you'll be first in line to stop using all the code that was paid for or contributed to open source software by these companies?

Here's an article from a couple of years ago that says that 57% of changes to the Linux kernel that year were made by programmers who were working for companies like Intel and (gasp) Redhat.

Edit: The article.

https://www.linuxfoundation.org/blog/the-top-10-developers-and-companies-contributing-to-the-linux-kernel-in-2015-2016/

→ More replies (1)

5

u/VikingofRock Apr 30 '18
  • Stop using RedHat.

RHEL 7.5 actually just deprecated python 2, and RHEL 8 will ship without it.

https://www.phoronix.com/scan.php?page=news_item&px=RHEL-8-No-Python-2

55

u/[deleted] Apr 30 '18

If you're really asking this question, you haven't been developing with python long enough.

The real problem with Python 3 is that the core development team set out to do a lot of good things, but broke compatibility in the process. And with that breakage meant that everyone using python had to step back and question whether it was worth it to scrap or upgrade years of legacy code. So when comparing the two together, there was almost no advantage in moving from python 2 to python 3. Today, the movement still has low value for these large legacy systems. There's no real performance gain, there's no must-have features, etc. The only gain here is that most of the systems are finally moving to python 3 as their stable python. And if a company did not decide to move to python 3, they will find support non existent starting in 2020.

To maybe also set your expectation, the core development team does not recommend any python version prior to 3.4, which was actually released in 2014, a full 6 years after the alpha and beta 3.0 - 3.3 pythons were released. And to add to that, I would argue that 3.6 (released in Dec 2016) was the first release where people should have started migrating. Last year is probably the first year where there was enough migration momentum that we're really starting to see strong 3.x traction. But note that it's truly only been the past 2 years.

27

u/buttery_shame_cave Apr 30 '18

there's no must-have features, etc.

well yeah because the dev team kept back-porting all the new stuff they were coming up with to 2.7.x - if they'd cut off the flow the pressure to migrate would have come on a lot sooner.

18

u/[deleted] Apr 30 '18

Basically the difference between the two versions now is "the one that breaks old code" vs "the one that breaks new code"

2

u/Silhouette Apr 30 '18

if they'd cut off the flow the pressure to migrate would have come on a lot sooner.

In computing history, trying to force people to upgrade fundamental technologies when they have a big investment in current versions and compatibility isn't guaranteed has rarely been successful.

-2

u/[deleted] Apr 30 '18

Just in case I wasn't clear.. there are still no must-have features in python 3 by comparison to python 2. Migration that happens at this point is primarily because python 2 is being deprecated in most systems.

6

u/buttery_shame_cave Apr 30 '18

again, because they kept back porting stuff they were adding to 3.x that wasn't in 2.x.

if they'd cut off the updates from 2.x it might have added some incentive.

2

u/ephimetheus Apr 30 '18

The experiment I'm working with (ATLAS) users python as a configuration/steering language for the C++ based event processing framework. That's stuck on python 2 and I highly doubt it's ever going to be migrated...

2

u/magnetic-nebula May 01 '18

I work on a scientific experiment where the development of the code began in the 90s. We need our code to work across a large variety of systems (including old computers that aren't reliably connected to the Internet).

Plus we're scientists, not programmers. NSF isn't giving us money to update code, so we don't have the $$$ to pay people to do it.

There's literally no reason for us to spend the time upgrading.

1

u/subheight640 Apr 30 '18

I use Python as a scripter for an engineering FEA program called Abaqus. Obviously as an expensive FEA software, Abaqus has refused to upgrade to 3, and they probably never will because they're too busy raking in the profit. So I'm stuck with 2 too.

The problem is compatibility.

1

u/wildcarde815 Apr 30 '18

there's a few other nuissance things, like they don't include all the test framework stuff with all versions. So my pystone demo program for teaching really basic HPC environment management and job submissions requires like... anaconda python 3.4?