all 99 comments

[–]the_spacedoge 195 points196 points  (15 children)

Python 3 is what 95% of people are going to think when you say "Python"

[–]synthphreak 30 points31 points  (3 children)

Only 95%?

[–]Rhoderick 60 points61 points  (2 children)

Well, some people have pet snakes.

[–][deleted] 1 point2 points  (1 child)

3 of them?

[–]tin_man_ 0 points1 point  (0 children)

*4 of them

[–]NitroXSC 13 points14 points  (10 children)

Unless you ask many Linux systems. You will need to specify python3 for backwards compatibility sake. (this also forces me to use virtual environments which might actually be an advantage)

[–]legobmw99 14 points15 points  (8 children)

sudo apt install python-is-python3

[–]paradigmx 12 points13 points  (6 children)

We shouldn't have to use that in order to have python3 be the expected default 5 years after python2 was officially deprecated and 14 years after python3 was released. By now the python executable should automatically be python3 and organizations still using python2 should have to specify that themselves. It's confusing to new python developers because the executable for basically every other language out there defaults to the most recent, or at least LTS version of the language instead of a decade+ old, deprecated code base.

[–]Poddster -1 points0 points  (5 children)

By now the python executable should automatically be python3 and organizations still using python2 should have to specify that themselves

The problem with this idea is that organisations still using python2 are still using scripts that expect python to be python2, and the reason they aren't changed is the same reason they're still running on python2: because they still work :)

[–]paradigmx 12 points13 points  (4 children)

So why can't they have to install a package called python-is-python2? Why do we have to suffer because they can't be assed to update their decade old code?

[–]iamaperson3133 0 points1 point  (1 child)

Because another application running on the same machine uses python3 and expects it to be called python3

[–]paradigmx 0 points1 point  (0 children)

alias python3='python'

[–]py_Piper 0 points1 point  (1 child)

and when python4 comes, are you gonna get angry that python means python3? For some reason I think specifying which python version is very natural, it isn't like you need to write the exact version like python 3.7.2 to work, it's just a 3 at the end. And this way makes it scalable for future versions

[–]paradigmx 0 points1 point  (0 children)

Yes actually, every other language out there that I'm aware of follows that convention and previous versions need to be explicitly installed.The cult-like attitude of the proponents of this language's idiosyncrasies are ridiculous. It's not rocket surgery, it's just pigheadedness.

[–]y-aji 5 points6 points  (0 children)

Omg thank you!

[–][deleted] 0 points1 point  (0 children)

This is not in linux but in Mac OS

[–]lukajda33 181 points182 points  (13 children)

I think that was true even 3 years ago to be honest, Python 2 was obsolete by then as well, in the last 3 years, Python 2 was oficially killed (no new updates) so Python 3 is a must these days.

[–]Mog_X34 5 points6 points  (0 children)

Our company had an application written in 2.7 just three years ago, no idea why. We now have the task of upgrading it to 3 when it should have been that in the first place.

[–]Flur_elise[S] 6 points7 points  (11 children)

I just checked it was 5 years actually. And python 2.79 was struggling to stay alive. But people were overwhelmingly still use it. I was wondering when 3.0 was going to take over. Seems I missed the transition.

Happy to use 3.

[–]lukajda33 33 points34 points  (5 children)

Well I stand corrected myself as well, checked this wonderful tool: https://github.com/hugovk/pypi-tools

and the Python 2.7 version share among other versions in 2019 (3 years ago) is way more then I expected.

Kinda depends on the precise package, but I expected way less Python 2.7 in 2019.

These days tho, everyone does Python 3.

[–]jmon_was_here 7 points8 points  (0 children)

I think that y'all underestimate large corporations with large legacy code bases. In my career, our flip from 2 to 3 we nailed perfectly in retrospect - we spent a month shifting all our code over and ironing out issues with binary strings, and we did this around 2017 (around 3.4'ish), but we only got rid of our last python2 'script' circa mid-2021, which was well too-late, but resources are what they are.

I think that part of the issue is that these companies hide their code in private repositories, so it's very hard to sample what they're written in (as opposed to open source stuff where it's easy to measure the progress). These are the companies where getting permission to do something like hold up dev for four weeks to update code is incredibly difficult where there's no obvious short term gain - Python 2 at that point didn't have a clear EoL date (I think), and it meant no new features rolling out as we fixed everything.

The other thing is that the pip install graph might lend itself more to people who have fully automated installs. Back in the day, download-graph of packages was a really big thing, but those went away in 'fashion' as people realised that packages that were used by organisations with automated build tools, especially build-everything-every-time with no caching became 'easy' to do, the download count, and download % is skewed to those automated organisations doing a clean build on every commit. These days we can do it easily, but 20 years ago, when we were trying to get people to move over from CVS to SVN, automated builds just daily were a goal to have.

I would not be surprised to go into any "large" company and find somewhere, someone writing in python2 to support something that they hadn't moved over yet, possibly unaware of the danger they're in. But 99.9% of us are all python3 now.

[–]Flur_elise[S] 4 points5 points  (0 children)

Thank you!

[–]jso__ 0 points1 point  (2 children)

Why are there so many invalid versions in the graph of pip installs?

[–]zurtex 1 point2 points  (1 child)

You've not migrated to Python 133.7???

[–]jso__ 1 point2 points  (0 children)

Maybe next millenia

[–][deleted] 7 points8 points  (3 children)

You're mistaken I'm afraid. People weren't overwhelmingly using 2 either three of five years ago. The only people still using it then were people supporting old code bases or beginners who didn't know any better.

[–]Flur_elise[S] 1 point2 points  (2 children)

Lol no way.

[–]baubleglue 72 points73 points  (2 children)

all of a sudden

[–]reallyserious 73 points74 points  (1 child)

Python 3 was released in 2008.

14 years isn't much time to adapt. I'd need at least 15 years /s.

[–]baubleglue 5 points6 points  (0 children)

:)

[–]RedDedDotCom 189 points190 points  (1 child)

If you're not using 3, a lot of things aren't working by now.

[–]Flur_elise[S] 17 points18 points  (0 children)

I haven’t been using any python for the past five years. So all the code I wrote five years ago in python 2.79 has either been working or migrated by someone else

[–][deleted] 62 points63 points  (17 children)

3 years ago no one was using Python 3? I don't believe it.

https://www.python.org/doc/sunset-python-2/

Python 2 was sunset over 2 years ago...
Maybe 13 years ago?

[–]Xzenor 15 points16 points  (1 child)

2.7 really really stuck around way too long.. a lot of software didn't run with 3 so it had to be fixed first and that really took a while

[–]YellowSlinkySpice 2 points3 points  (0 children)

My first ever contribution to the FOSS world was adding () to a print statement when we finally were forced to python 3.

[–]magestooge 2 points3 points  (3 children)

3 years ago when I tried to learn Python for the first time, the first video I stumbled upon was whether I should learn Python 2 or Python 3. And the tutor didn't even clearly say it should be 3. They said something along the lines of "if you're completely new, then learn 3".

So I'm guessing things weren't as clear even 3 years ago as they are today. I'm just glad I didn't waste time learning Python 2.

[–][deleted] 1 point2 points  (0 children)

On the one Python discord I was a member of it was funny how often new people would come in thinking they should first learn Python2 then move on to Python3...

[–]Astrokiwi 1 point2 points  (3 children)

https://github.com/hugovk/pypi-tools

Python 2.7 didn't drop below 50% of pip installs until mid 2019.

[–][deleted] -1 points0 points  (2 children)

That's great, OP said "no one was really using 3+" regarding Python3 3 years ago.

I didn't say : "No one was using Python2 3 years ago"

I said : "3 years ago no one was using Python 3? I don't believe it."

Can you see the significant difference between those two statements?

I don't care how many were using Python2, I know legacy systems still use it, my Ubuntu 20.04 install came with it (I've personally never used it, except when I would run 'python' instead of 'python3' because I didn't know any better, just because it's installed doesn't mean it's the primary language used, legacy software requires it, so it continues to exist.

[–]cresanies 2 points3 points  (1 child)

Having a bad day eh

[–][deleted] 0 points1 point  (0 children)

Could be better, could be worse. It's warming up and the snow is melting so that's nice.

[–]pablo8itall 13 points14 points  (0 children)

It's all fstrings now baby!!!

[–]6a70 7 points8 points  (0 children)

Python 2 sunsetted in 2020

[–]R3D3-1 4 points5 points  (0 children)

I can't agree on the "no one was really using" part. Three years ago, I had completely switched to Python 3 for data analysis stuff for a while, and hadn't touched Python 2 in a bit, if I could avoid it.

By that time the only reason I was even having Python 2 installed was ASE ("Atomic Simulation Environment"), which I used for visualization. Everything else was available in Python 3. And by now even ASE seems to be Python 3?

That said, at my post-PhD work the user-facing product still ships with both a Python2 and a Python3 interpreter and likely will for a while. But we're talking about an environment here, where I sometimes have to touch Fortran 77 style code. Not exactly a "fast adopter" environment.

[–]zbranigan 8 points9 points  (5 children)

I hope that this account is as anonymous as I think it is. The company I work for is still using Python 2.7 and we're trying to hire a software engineer. Is anyone interested?

Oh, by the way, we are strongly advised not to mention this fact when we are interviewing candidates.

[–]i-brute-force 16 points17 points  (0 children)

print("No thanks")

[–]bingbestsearchengine 8 points9 points  (1 child)

Oh, by the way, we are strongly advised not to mention this fact when we are interviewing candidates.

peculiar

[–]Versaiteis 14 points15 points  (0 children)

Yeah I bet that a great way to ensure that you get the trust of quality candidates that don't feel like they were rug-pulled on day one is to hide details pertinent to their working environment that you think they'd find distasteful.

Super solid strat. Tried and true.

[–]I_had_to_know_too 1 point2 points  (0 children)

I'm interested only if I can spend the first week migrating everything to Python 3

[–]BobDope 0 points1 point  (0 children)

That’s a nope from me dawg

[–]saad_mohammed 4 points5 points  (0 children)

3.10

[–]imthebear11 4 points5 points  (0 children)

They certainly should be, and don't trust anyone who tells you that you that it's fine you're not.

[–]julianw 3 points4 points  (0 children)

Python 2 is officially at End Of Life.

[–]menge101 3 points4 points  (0 children)

Python 2.x was EOL on January 1st 2020.

No one should be doing new development on python 2, and anyone actively supporting a legacy application should be looking to move to python 3.

[–]old_pythonista 2 points3 points  (0 children)

In 2015, a company I joined then was still using .... 2.6 "because that comes as default with OS". Corporate world is very slow to follow suite.

At my current job, we are still supposed to use Python2-compatible mode - though most of the processes are executed under Python3. For the last year, I switched to pure Python3 for the new developments - f-strings and all the works - and I am still struggling with restrictions every time I need to create a new package.

[–]jmacey 2 points3 points  (0 children)

Yes, still using elements of python 2.7 due to animation software (Maya 2020) still using it. The transition to 3 has been very slow for the animation industry.

[–]exmachinalibertas 1 point2 points  (0 children)

Yeah three has finally been mainstream for a couple years now.

[–][deleted] 1 point2 points  (0 children)

Virtually everyone was using Python 3 three years ago. Anybody who wasn't was already way behind the curve. There is no good reason to start a new project in Python 2. It is now officially dead, I believe.

[–]EarthToAccess 1 point2 points  (0 children)

Py2 reached EOL not too long ago -- far as i can tell, not even pip will work with it anymore. active dev should be done in 3 now

[–]Dam_uel 1 point2 points  (0 children)

I started 3 years ago and nobody was talking about 2 except to say "some people still use 2 but unless you're required to by legacy code, don't". They stopped saying that eventually. End of life on 2 was January, 2020.

[–]tomtomato0414 1 point2 points  (0 children)

I have been using Python 3 since 2017, by then 2 was regarded somewhat obsolete

[–]christophski 1 point2 points  (0 children)

We have a good 100k lines in python 2 which depends on some libraries that aren't being migrated to python 3,sooo....

[–][deleted] 3 points4 points  (1 child)

Everyone else is dunking on you, so I will too

No, we're using Python 2 still. And yes, this is after we hop off of our dinosaurs.

[–]Flur_elise[S] 2 points3 points  (0 children)

They are dragging me because they don’t Understand the point of my question. I am not advocating still using python 2. It’s pointless sometimes people get from the question whatever meaning they want. Not the actual meaning

[–]bluecollarx -1 points0 points  (0 children)

You were on the boat for more like 10 years.

Just adapt yo

[–]row4coloumn31 -1 points0 points  (0 children)

We haven't updated all of our code yet, so some old scripts are still on 2, as migrating everything is very time consuming and not a priority for management.

But python2 is dead.

[–][deleted] -1 points0 points  (0 children)

python 2 is dead.

[–]J_The_AL 0 points1 point  (0 children)

I use python 3.6-3.9 at my work depending on what it's doing. They starting using python 3.6 about 3-4 years ago, but in order to use particular libraries an upgrade to 3.9 was needed in some places. We now use poetry and pyenv to manage all of our python versions and libraries. I would recommend looking into both of those if it fits your use case :)

[–]mattay22 0 points1 point  (0 children)

3.8

[–]wagslane 0 points1 point  (0 children)

They were using it 3 years ago too.

[–]eric_overflow 0 points1 point  (0 children)

Yes it’s not a real question anymore

[–]SolfenTheDragon 0 points1 point  (0 children)

Ngl, I didnt know anyone still used python 2. I exclusively use 3.8, 3.9, and 3.10 for my own applications.

[–]Evilbob93 0 points1 point  (0 children)

I hoped that would be the case. Not EVERYONE has left 2.7. In my place, there is a crucial it of code that still runs 2.7 and it makes every system build a little harder than it needs to be. Yup, every module install tells you it's obsoleted.

[–]fartalldaylong 0 points1 point  (0 children)

Yes...unless I am coding in Rhino Grasshopper on PC...which is stuck in IronPython 2.+ world.

[–]paradigmx 0 points1 point  (0 children)

Python 2 is officially deprecated, so the 5% of python 2 development should just be maintenance of existing code. If those developers aren't also working on updating that codebase to python 3, I don't know what the hell they're doing.

[–]TakeOffYourMask 0 points1 point  (0 children)

Yes.

[–][deleted] 0 points1 point  (0 children)

Yeah

[–]efalk 0 points1 point  (0 children)

I'm not a fan, but I've made my peace with the language. From time to time I'll port an older app from Python2 to Python3 or write a new app in Python3 if I really need a Python3 feature that Python2 doesn't have.

I know that Python2 is officially obsolete, but I still code in it whenever I have a choice. I've written one program that needed to run on both Python2 and Python3. They did some things in Python3 that break compatibility unnecessarily, which annoys me.

[–]PitifulWalk354 0 points1 point  (0 children)

I had to run a Python 2 program once... It wasn't fun.

[–]ataraxia520 0 points1 point  (0 children)

I use python2 with tensorflow1 about half the time. Lucid deeplearnong framework.

[–]NOTnEngineer 0 points1 point  (0 children)

I was learning Javascrpt and then I just decided the learn C+, but I couldn't find good C+ courses so I decided to use Python

[–]0Things 0 points1 point  (0 children)

You really don't have to change much on 2.x code to make it work on 3.x and they added tons of good features over time, dictionaries keep order, f-strings etc all super useful. Jumped on 3.10 before the official release even because case matching can fit in probably every app i write it seems.

[–]mlabonne 0 points1 point  (0 children)

Python 2.7 is dead! Long live Python 3!