22 ms·
Apple removes Python 2.7 in macOS 12.3 beta
- alilleybrinker 5y agoWeird to see this described as a "deprecation," when really it's removed entirely.
- swiftcoder 5y agoIt's the end of an (extremely lengthy) deprecation process
- alilleybrinker 5y agoSure, and perhaps in that context "deprecation" is the right description, but in general I've only heard that word applied to an API being in-process for removal, not as the descriptor of the final removal itself.
- swiftcoder 5y agoRight, but this is a standard section in the release notes, where they provide status updates for ongoing deprecations.
- tasha0663 5y agoDeprecate, from Latin deprecari, "to pray (something) away". It would seem the gods eventually answered! OT: it's the same precari that is in precarious, which originally meant something more like "dependent on the will of another". Both definitions have loosened nicely, but it's still fun to see how we got here, and to think of marking something Deprecated as an act of piety!
- sprite 5y agoHas 12.2 been unstable for anyone else on M1? I've had 2 crashes since installing it where my system becomes unresponsive and reboots by itself.
- techy_hacker 5y ago
- kkirsche 5y agoYay! Glad to see this rather than the Red Hat approach of continuing to support dead versions (yes, I know that enterprises value stability blah blah blah)
- solarengineer 5y agoThe way I have always understood it - the Python that RedHat supplies is intended for it's scripts. If we install our own packages or remove any packages, then the risk destabilising the system. I have seen situations where people have removed python packages that resulted in yum no longer working, for e.g. Hence, I have always (including from the RHEL 6.x days) provided my own local python version by compiling and packing as a custom rpm. I now use venv to do the same.
- Un1corn 5y agoActually RedHat no longer ships Python since RHEL 8, instead they have platform-python for internal use of the operating system and you need to explicitly install the Python version you want
- mroche 5y agoThis is a RHEL 8 only feature, RHEL 9 will have a global python3. Whether alternative version are offered as modules or as side-by-side installs like in Fedora, I do not know. https://koji.fedoraproject.org/koji/search?terms=python%5B2-3%5D.%28%5B5-9%5D%7C%5B0-9%5D%5B0-9%5D%29&type=package&match=regexp https://koji.fedoraproject.org/koji/search?terms=python%5B2-...
- tombert 5y agoWhen I was at Apple, they discontinued bundling the command line version of emacs, and they sent a long internal email stating why. The stated reason was that any newer emacs would suffer from license incompatibility with macOS, and they didn't see the point of supporting a 10 year old version that the FSF doesn't even support when, if someone really wants emacs, it's just a `brew install emacs` away. I can't say I disagree.
- KptMarchewa 5y agoFinally.
- DocTomoe 5y agoPython 3 released in 2006. 2.7 was sunset two years ago (after a 5 years stay from execution). No one can claim they did not have enough time to make the switch.
- indymike 5y agoAlso, making the jump to Python 3 is not nearly the amount of work that I thought it would be.
- bdowling 5y agoClearly your programs don't handle binary data.
- indymike 5y agoThey did and do. That was the hard part, though. It helped that we had good unit tests.
- bdowling 5y agoSorry for my short comment. I'm glad you understood what I meant. For anyone else who reads this, strings and str() went from being arrays of bytes in Python 2 to Unicode strings in Python 3. That change broke a lot of programs and is one of the most criticized Python 3 changes.
- Rygian 5y agoNot much of a choice anyway. Choosing to keep an unsupported piece of software in the system is a security liability.
- gabkins 5y agoAgreed on this one, a great move tbh.
- zionic 5y agoIt’s also about (damn) time. I know it shouldn’t, but the python community’s bizarre behavior during the 2.X -> 3.X move honestly made me think less of the language. Tech is supposed to just be tech, but when the community behaves this badly about adopting improvements how can that not influence your decision to invest in that tech? If 2.X -> 3.X was such a drama fest what’s gonna happen next time they need to upgrade? Etc
- mikewarot 5y agoThey forced incompatible changes on their users, all in the name of a Unicode fetish. They burned their credibility. The users acted rationally, it's the developers of Python who were abusive.
- Spivak 5y agoI think it’s less of a fetish and more of a “we made a huge mistake in the initial design of the language and confused text and the encoding of that text making a giant footgun that was hard to avoid. The migration was difficult because you had to actually think about this stuff instead of it working by accident and living as a landmine if you encountered non UTF-8 text. The fact that you actually have to decode your bytes and specify an encoding makes it really obvious when you’ve just assumed the world is UTF-8 without really backing it up.
- ant6n 5y agoWhat I don't get is it they break the language anyway, why they didn't fix classes. Most of python is pretty beautiful, but classes are so ugly, even basics like what is the Syntax for instance vs static cars, self/this, setting up constructors, calling inherited constructors. Like come on, how is it that they are uglier than Java in this regard.
- Wowfunhappy 5y agoWhat? In a point release? We all knew this was coming, but doing it in a point release seems like exceedingly bad form, particularly as Apple does major releases annually. I never expect point releases to break stuff, at least not on purpose.
- empthought 5y agoThe risk of unpatched vulnerabilities between now and the next "major release" far exceeds the risk of inconveniencing anyone foolish enough to rely on the system Python 2.7 installation.
- necovek 5y agoWhat server-oriented GNU/Linux distributions do is to keep patching those vulnerabilities themselves. If they need to do it for a year, it's not that hard.
- nicce 5y agoBut is it worth it actually? I doubt that this MacOS version is used on servers…
- mattl 5y agoDefine server. Public webserver? Unlikely for sure. Office fileserver? Absolutely. Build server? Sure.
- nicce 5y agoIf we go to that road, how often you need Python 2 for fileserver or build server? Now, what is the percentage of that among all MacBooks on latest MacOS out there.
- reaperducer 5y agoIf we go to that road, how often you need Python 2 for fileserver or build server? Monthly, for me. Or more often if, like last week, a new customer required it.
- nicbou 5y agoDoes MacOS ship Python 3 by default? I've been using homebrew for so long that I forgot.
- msoad 5y agoThey decided to not ship anything and let you download it yourself.
- metageneralist 5y agoand I like it this way
- gsnedders 5y agoThis is true, but it's also worthwhile noting that python3 is included with Xcode (or the Xcode Command Line Tools).
- nottorp 5y agoWhich you need anyway for brew/port, so most people that need a python in the command line will get it installed without noticing.
- eli 5y agoIt did as python3, but the default python was still 2.7, though it's had a deprecation warning for a bit.
- WesolyKubeczek 5y agoIt's possible there was a script lurking somewhere under /System/Library/CoreServices that might have needed Python 2. The script got rewritten/snipped off, and there you go.
- koenigdavidmj 5y agoUp until 12.3, it did. Now, it's included in the CLI tools. You know how when you run 'clang' or any of those, it's a wrapper that offers to download the real tool for you? That's how the 'python3' binary works now.
- floam 5y agoMakes shebangs easier
- Entalpi 5y agoFinally.
- vr46 5y agoGood
- jordiburgos 5y agoChecking on my machine, I have to run "python" or "python3" executables. How is it going to be when that is removed? "python" will throw error and only "python3" will be available? "python" will run Python 3?
- somenewaccount1 5y agoWell, 'python' is not going to run 2.7, can tell you that. Maybe it will run ruby though? Idk, it will probably run python 3.
- duped 5y agoYou will need to install a supported python executable and add it to your shell's PATH variable, like any other language implementation.
- CountSessine 5y agoMacOS includes cpython 2.7 and 3.x by default. The OP is wondering about what `/usr/bin/python` will point to now or whether it will even exist.
- edgyquant 5y ago/usr/bin/python will be a script that tells you to install Xcode utilities if it doesn’t find python3. At least that’s what I understand
- chrisma0 5y agoI like their framing here. No more Python 2.7: use Python 3 or "an alternative language instead". Rewrite in Erlang! :)
- unfocussed_mike 5y agoThey've done some contentious things in point updates but this is really going to put the cat among the pigeons, especially with the "alternative language" jab. Way to rub salt in the wounds :-)
- pcj-github 5y agoSo will the command "python" be available out of the box (as python version 3) Or do scripts and users explicitly need to say "python3"?
- loeg 5y agoNeither - Python 3 will not be included out of the box, either.
- BoardsOfCanada 5y agoFinally I'll be able to just autocomplete pyt <TAB> on the command line.
- epberry 5y agoGreat move. Next up: Ubuntu.
- mrweasel 5y agoThat would be awesome, they can stop yanking the venv out in a separate package while they’re at it.
- buzzwords 5y agoAnyone know the real reasons why this took such a long time? If it wasn't priority why?
- waynecochran 5y agoThere must have been breakage in some code when ran w Python 3. Apple is usually the quickest to deprecate things…
- nexuist 5y agoApparently some Automator scripts and a preinstalled command line utility named "xattr": https://apple.stackexchange.com/a/362783/364414 https://apple.stackexchange.com/a/362783/364414 EDIT: According to one of the commenters xattr is now a binary instead of a Python script, so that's probably the real reason why they got rid of 2.7 now!
- buzzwords 5y agoBut xattr is opensource, Apple didnt want to invest some engineering time and effort to upgrade those packages?
- savrajsingh 5y agopyenv install 2.7.18 :)
- flykespice 5y agoLinux distros should do the same
- fanatic2pope 5y agoIIRC Fedora dropped python2 in the default install a couple of years ago.
- abdusco 5y agoDoes this mean I can choose python3 when writing Alfred workflow scripts? Or is there another way to add another interpreter to the list[0]? [0]: It consists of bash, zsh, php, ruby, python (v2), perl, osascript on my machine
- ArchOversight 5y agoTalk to the developers of the Alfred app?
- zowers 5y agopython3 is not included by default as well in macOS 12.3 python3 prompts to install command line developer tools
- forgingahead 5y agoAbout bloody time - the sooner we move on from the Python 2 to Python 3 fiasco, the better. I get hives every time I see a nice project on Github, recently updated, with "Tested on Python 2.7".
- TheRealPomax 5y agoOnly 14 years after 3 was released, and over 2 years after 2.x was truly killed off for good , but better late than never. Bundling a dead technology that users couldn't remove or update made using actual normal python borderline impossible without being forced into a third party software manager.
- jeroenhd 5y ago> for good Sadly, there are still some "enterprise" Linux distros that ship 2.7...
- TheRealPomax 5y agoShipping with it is not the same as "if you uninstall it, which you can't even do unless you boot into safe mode and turn off kernel lever application protection, your OS is now broken beyond repair and you'll need a full reinstall", though.
- savant_penguin 5y agoGood night sweet little prince
- outside1234 5y agoGreat - better that it is just not there than accidentally use it over Python 3 at this point.
- runjake 5y agoApple has been warning people for several years[1]. It's continued to be included in macOS until they could resolve dependencies with shipped software. And Python 3 is still there. 1. https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes#Scripting-Language-Runtimes https://developer.apple.com/documentation/macos-release-note...
- ArchOversight 5y agopython3 is not included, unless you install Xcode. It's now a shim!
- my123 5y agoNote that a full Xcode install isn’t required, Xcode-select —-install (500MB or so command line tools bundle) includes Python.
- jessriedel 5y agoIs this new or has it always been true?
- my123 5y agoFor Python 3, has been true since Apple started shipping Python 3 on macOS. For Python 2, it was bundled within the OS itself.
- runjake 5y agoYou are right (but, it’s specifically the XCode Command-line Tools). Thanks for the correction!
- D13Fd 5y agoFinally! I’m a big fan of Python, but I hope they remove ALL Python from the OS itself. I’ve spent many hours over the years messing with setups to resolve bugs caused by python scripts picking up the Mac OS python install rather than the user-installed version. They really shouldn’t be bundling any Python version with the OS - the user should choose the versions installed. It’s much cleaner that way.
- sylens 5y ago100% this.
- simonw 5y agohttps://xkcd.com/1987/ https://xkcd.com/1987/ says it all.
- amznbyebyebye 5y agoThat’s hillarious. It’s why I love Rstudio.. don’t have to deal with any of that as someone who is just trying to prototype and get something to work.
- dehrmann 5y agoSome of this is brew-specific. The way it handles ownership isn't great.
- bin_bash 5y agoI'm not sure if it resolves your ownership issues, but I am glad they went with `/opt/homebrew` in ARM Macs to at least keep homebrew in its own directory.
- Spiritus 5y agoPython 2 is available from the https://github.com/lithammer/homebrew-deadsnakes https://github.com/lithammer/homebrew-deadsnakes Homebrew tap.
- baochan 5y agoCan someone explain why Python is included as part of the operating system to begin with?
- fault1 5y agoA lot of system scripts are written in python.
- AaronFriel 5y agoRemoving python2 is great, but as someone who writes an awful lot of scripts and makefiles that need to run on Mac & Linux, I'd love for them to update bash and coreutils. It's not fun discovering `uuidgen` has different args because my coworkers have a 2007 version of the program, or they think `pushd` works in a cross-platform makefile. Repeat those problems for every GNU utility. A tiny little bit of GPL3 software won't kill them, and surely shipping up to date utilities is easier than backporting security fixes over nearly two decades.
- andrei 5y agoThis was a big reason for why our entire eng team moved to linux
- Spivak 5y agoThis seems like a lot when you're one brew install bash/zsh coreutils away. I have a script that installs all the GNU utils, and does the thing so that the you can use the g versions by their normal name. I haven't even noticed any of the outdated userspace.
- bumblebritches5 5y ago
- filmgirlcw 5y ago> A tiny little bit of GPL3 software won't kill them, and surely shipping up to date utilities is easier than backporting security fixes over nearly two decades. I don’t disagree at all but I’m not a lawyer at Apple, so I can’t speak to their general risk or not. The good news is that the zsh included is at least recent and it is (thankfully) trivial to install and alias a newer version of bash, but I have totally been bit by this myself.
- dagmx 5y ago> A tiny little bit of GPL3 software won't kill them Depending on the way the code is hosted or used, there might not be such a thing as "a tiny little bit of GPL3" There's a reason why the GPL3 license is so vague in parts about its boundaries and why many corporate lawyers see it as viral.
- scoofy 5y agoAww... what a time to be alive. End of an era, etc. I'm excited to never have to type "alias python=python3" ever again.
- gunapologist99 5y agoIt's about time. Python shouldn't be in the OS at all, and definitely not for core system utilities that need a working (and small) interpreter with few dependencies that can be easily upgraded. The way the Python community handled the deprecation and EOL of 2x was a total disaster. Python isn't (or wasn't) only a toy language. It was being used for real, production code, in many cases for a decade or more. That's not to say that upgrades should be impossible, but (except for security patches), a language is such a core piece of infrastructure that you can't change it in an incompatible way without breaking working systems everywhere, and for no reason. It was truly bizarre that a new, backwards-incompatible version was created really just to fix a missing unicode datatype and add async. Both of these could have been added to the core language or as a library. In fact, I'd argue that even if adding that to the core language was quite difficult (and I don't believe it would have been), it doesn't matter, because you don't break production code. Python was a nice language to read and write, but considerations of long-term community support, your ability to support deployed apps, a commitment to backwards-compatibility, packaging, and a focused and workable deployment story, are all eminently practical concerns that (in many cases) completely override any otherwise nice features of the language. The strange behavior of the python community seemed to indicate that they're not at all interested in the billions or trillions of lines of production Python 2x code out there, and that if you are going to eventually upgrade the underlying OS, you now have to completely rewrite all of those lines, even if the original developer isn't even there anymore and the app was working just fine. It was the Y2K problem all over again, but this wasn't due to short-sightedness or byte thriftiness while coding from 20 years prior, but simply because the developer bet on the wrong horse! But what a pretty horse.. Some people still say, "oh, but there were ten years before it was EOL'ed", but the reality is that Python 3000 was never spoken of as being the next (completely incompatible) version of Python, but instead was an experiment, until one day it wasn't anymore. And then it became Python 3. And, far, far worse: the PSF took an extremely aggressive stance about enforcing the trademark and not allowing a fork (even maintained by others) of Python 2x. This is extremely antithetical to open source principles. Python's pain was largely self-inflicted, and Python proved that it really only wanted to be a hobbyist language. Some languages might have aspirations of being a 100 year language, but apparently not Python. Many people (including me) have now spent millions of dollars ripping and replacing Python code. Sure, we should have seen the writing on the wall back in the Python 3000 days, but, surely, we might have thought, didn't the PSF just see what happened with the Perl 5/6 debacle (a similar backwards-incompatible split that split the community and basically killed Perl) a few years prior and weren't going to make the same mistake?
- qwertox 5y agoI just hope that they don't make the same decision as Debian where they made `python` launch `python3`. It's really useful if `python` is simply removed, like they did in Ubuntu. There you'll know immediately that your script which invoked `python` was about to execute a v2.7-script. Else you might get errors which only crash the script when a rarely used path is executed.
- bumblebritches5 5y ago
- vl 5y agoCorrect title should be “Apple removes Python 2.7 from macOS in favor of Python3”
- dagmx 5y agoThat would be incorrect. It's not being replaced in the OS with python3. It's just being removed.
- vl 5y agoBut current title implies that there is no Python left at all, which is "more" incorrect.
- angulardragon03 5y agoA fresh installation of macOS 12.3 will not contain Python. python3 is a shim, when you run it it tells you you need to install the XCode CLI tools. It is not included by default.
- dagmx 5y agoThere is no Python left at all unless you install it via other tools like Xcode or brew
- stblack 5y agoThis saddens me for the following reason. When I introduce young people to coding, it's always great to know their Mac has Python and Ruby on board, and we can quickly drop into a Python shell, or create a trivial .py file, and have some fun. This frictionless entrée appears done. That's a bit of a shame to be honest.
- kortex 5y agoJust use repl.it? Honestly it's even easier, you don't have to think about dependencies, you just "import numpy" and woah it just installs it for you when you hit run! https://replit.com/ https://replit.com/
- ConfusedDog 5y agoOkay. my powerline finally gonna go away I guess. Gonna go with oh-my-zsh then.
- deleted 5y ago[deleted]
- YeBanKo 5y agoGreat! This is a security thing, it sunset two years ago, PSF does not even provide security updates any more. There is no good reason it should remain on user computers.
- olliej 5y agoTo this day I still don't see which changes in python 3 warranted breaking backwards compatibility with python 2.
- rbanffy 5y agoIt was about time. If you really need 2.7, you can get it from MacPorts. BTW, if you develop in and for Python, you should not use the Python from the OS.