News for hackers. Stuff that matters.
Re:Apple removes Python 2.7 in macOS 12.3 beta by dosethree on Friday January 28, 2022 @01:41PM (#30118661)
When I have to install a CLI tool and it's in python I sigh loudly. Happy that many CLIs have moved or are moving to golang
Re:Apple removes Python 2.7 in macOS 12.3 beta by saila on Friday January 28, 2022 @02:31PM (#30119252)
I use pipx for this. It isolates each tool in its own virtualenv. You might still have to install a specific Python version (although the latest 3.X works fine for me), but it takes some of the pain out of the process and makes sure you don't pollute your global/system install.

On a Mac, it could be as simple as (assuming you already use Homebrew):

    brew install python
    brew install pipx
    pipx ensurepath # adds ~/.local/bin to $PATH
    pipx install <tool>
    <tool>
Re:Apple removes Python 2.7 in macOS 12.3 beta by Too on Saturday January 29, 2022 @01:16AM (#30124204)
Pipx is really one of the best things that has happened to Python recently. Taking away all the headaches of manually managing venvs. They should integrate it into mainline imo.
Re:Apple removes Python 2.7 in macOS 12.3 beta by gullevek on Monday January 31, 2022 @02:53AM (#30145586)
That is all nice. And then python updates from 3.9.n to 3.9.n+1 and nothing works anymore.

brew sucks with python.

Re:Apple removes Python 2.7 in macOS 12.3 beta by saila on Monday January 31, 2022 @06:00PM (#30156018)
I've only run into issues like this when upgrading from Python 3.X to 3.Y, which is to be expected, and Homebrew lets you install a specific 3.X (e.g. brew install [email protected]) if you don't need/want be on the latest version.
Re:Apple removes Python 2.7 in macOS 12.3 beta by ldrndll on Friday January 28, 2022 @02:54PM (#30119522)
Thanks, I didn’t know about pipx. If it works as advertised that will be a huge improvement for me!
Re:Apple removes Python 2.7 in macOS 12.3 beta by oars on Friday January 28, 2022 @09:01PM (#30123026)
pipx looks fantastic, thanks for sharing.
Re:Apple removes Python 2.7 in macOS 12.3 beta by sixothree on Friday January 28, 2022 @03:09PM (#30119675)
As a non python native, I sigh whenever I have to install anything in python. There's always a dependency I can't find and never know why. I never understand why the dependencies aren't just resolved by an application and local to that application. I mostly end up with something working. Sometimes I just create a VM for that single application.
Re:Apple removes Python 2.7 in macOS 12.3 beta by pdimitar on Friday January 28, 2022 @04:04PM (#30120343)
I once really desperately needed a Python tool. Wasted an hour and getting more and more enraged trying to install it, overwriting hell-knows-what and ruining god-knows-how-many other programs in the process. Eventually it did occur to me to just use Docker and that did it. <facepalm>

Every time I am forced to do something with Python I end up hating it. It seems those who write it are just not interested in anyone who doesn't have a complete dev environment setup for it. :(

Re:Apple removes Python 2.7 in macOS 12.3 beta by sixothree on Friday January 28, 2022 @09:30PM (#30123204)
> It seems those who write it are just not interested in anyone who doesn't have a complete dev env...

And that's probably what makes Python so popular, and so great. I get it. It's attractive to people who aren't developing software for other developers.

But what you described is surely the result of that atmosphere.

Re:Apple removes Python 2.7 in macOS 12.3 beta by pdimitar on Saturday January 29, 2022 @07:21PM (#30132134)
> And that's probably what makes Python so popular, and so great. I get it.

I don't follow because that's actually a problem. Imagine having to install Haskell compiler -- exactly one particular version of it with the exact right combination of flags (and there are hundreds of them) -- for each project... while also having the whole thing kind of compile from source.

And that for people who just want to do something like `brew install a_valuable_tool` and have no patience (and certainly not the time) to tinker with Python's dev environment just so they can install a tool they need.

So maybe I am misunderstanding but no, that's not what makes Python popular or great, at all. It makes it a legendary pain for anyone who doesn't code it every day.

If I can't do `brew install your_tool` but have to fiddle with the intricacies of your language's ecosystem then you have failed as a tool author.

Contrast this with Golang tools (disclaimer: I dislike Golang) which in the worst case scenario involve 1-2 commands to download and compile+install the tool but usually don't involve even that because Golang's process is self-contained and that makes it super easy for all package managers to distribute it pre-compiled for their platform.

Re:Apple removes Python 2.7 in macOS 12.3 beta by erik_seaberg on Saturday January 29, 2022 @04:01AM (#30124913)
The distro should be packaging software for end users, relying on the python version they maintain. The problem is that Apple isn’t doing that at all, and brew seems to have issues getting all formulas to converge on known-good dependencies.
Re:Apple removes Python 2.7 in macOS 12.3 beta by ideologysec on Friday January 28, 2022 @05:46PM (#30121520)
Try Anaconda (or miniconda/mamba): like virtualenvs but reproducible, dependency pinning, and a great solver. All in one handy tool
Re:Apple removes Python 2.7 in macOS 12.3 beta by sixothree on Friday January 28, 2022 @09:28PM (#30123192)
Thank you.