News for hackers. Stuff that matters.
Re:Escaping from Anaconda's Stranglehold on macOS by dumbo-octopus on Sunday September 01, 2024 @05:47PM (#41420671)
Yes. I recently had to debug my gf’s entire work computer setup getting fubar’d from installing a pip package at a user level that conflicted with the name of some package used internally by the 10k+/seat/year software the company devices have installed. Proximal cause? The installer “helpfully” failed over to installing at the user level when she didn’t have permissions to write to the place she told it to. Root cause of course is that million dollar fancy fancy enterprise software somehow being unable to give itself an isolated python package namespace, or provide any relevant errors when conflicts occurred.

The python packaging system has to be used in case studies of worst design decisions of all time.

Re:Escaping from Anaconda's Stranglehold on macOS by adolph on Sunday September 01, 2024 @06:15PM (#41420866)
> package used internally by the 10k+/seat/year software the company devices have installed

Sounds like a skill issue that shouldn’t be seen in “10k+/seat/year software.” I wonder what other fails are in it.

Re:Escaping from Anaconda's Stranglehold on macOS by dumbo-octopus on Sunday September 01, 2024 @06:23PM (#41420922)
Well it constantly crashes and requires every shop to develop their own half-broken way of interfacing between it and other industry-standard software, but at least ~half the pixels you’ve seen in any modern movie or tv show have been touched by it at one point or another. So that’s interesting.
Re:Escaping from Anaconda's Stranglehold on macOS by geysersam on Sunday September 01, 2024 @06:40PM (#41420999)
Thats extremely fascinating. What's it used for?
Re:Escaping from Anaconda's Stranglehold on macOS by dumbo-octopus on Sunday September 01, 2024 @09:00PM (#41421636)
By the books Digital Compositing, but Editors also gravitate towards it for generalist work.
Re:Escaping from Anaconda's Stranglehold on macOS by AtlasBarfed on Sunday September 01, 2024 @07:40PM (#41421270)
Python has dogshit package management that makes java look well thought out and sane.
Re:Escaping from Anaconda's Stranglehold on macOS by echelon on Sunday September 01, 2024 @11:12PM (#41422309)
PYTHON @&$!!

The Python community needs to solve this ASAP. This almost weekly pain point has turned a language I used to love in college into one of my most despised languages. The fact that the ML community uses this broken platform is infuriating.

Make a Python version 4 that focuses only on fixing the packaging. 100% per-project hermeticy. No global packages whatsoever. Solve just this issue and bring the entire ecosystem on board. Kill all the various virtualenvs, the anacondas, global packages. All of it.

Learn from Rust/Cargo. That project does it mostly right (sans lack of namespaces and reproducible builds).

Re:Escaping from Anaconda's Stranglehold on macOS by mr_toad on Sunday September 01, 2024 @11:42PM (#41422402)
Wouldn’t this end up like the XKCD standards cartoon. You’d have yet another Python package system and even more fragmentation.

https://xkcd.com/927/

Re:Escaping from Anaconda's Stranglehold on macOS by ethbr1 on Monday September 02, 2024 @12:14AM (#41422525)
If Python users weren't comfortable living in that reality already, they wouldn't still be Python users.
Re:Escaping from Anaconda's Stranglehold on macOS by Eisenstein on Sunday September 01, 2024 @11:28PM (#41422361)
It took 10 years to force a breaking migration from Python 2 to Python 3 in order to handle Unicode...

I have resigned myself to repeatedly smashing my keyboard on the desk until it rains keys in blind rage induced frustration to let off steam and then calmly creating an issue in the appropriate repo instead of allowing even a modicum of hope that this will ever be fixed systemically.

Re:Escaping from Anaconda's Stranglehold on macOS by superlopuh on Monday September 02, 2024 @03:14AM (#41423278)
As far as I'm concerned, this is the fix: https://github.com/astral-sh/uv
Re:Escaping from Anaconda's Stranglehold on macOS by jampekka on Monday September 02, 2024 @06:32AM (#41424223)
It's never going to be solved. The mess is deeply ingrained in the Python development culture.

https://peps.python.org/pep-0582/

Re:Escaping from Anaconda's Stranglehold on macOS by 1propionyl on Monday September 02, 2024 @12:15AM (#41422527)
> that makes java look well thought out and sane

That's not hard. Java's package management is well thought out and sane.

Re:Escaping from Anaconda's Stranglehold on macOS by lupire on Monday September 02, 2024 @09:19AM (#41425171)
Well, it's still PATH based, which is much worse than virtual environments (directory scoped) or Nix (well-versioned sharing).
Re:Escaping from Anaconda's Stranglehold on macOS by pavlov on Monday September 02, 2024 @03:26AM (#41423320)
Python's package management makes JavaScript look well thought out and sane.

The bar is so low, you have to excavate it from a landfill of rotten node_modules...

Re:Escaping from Anaconda's Stranglehold on macOS by jampekka on Monday September 02, 2024 @06:31AM (#41424214)
Node.js has (or at least had before the ES6 mess) the sanest and best thought out package manager out there.
Re:Escaping from Anaconda's Stranglehold on macOS by dumbo-octopus on Monday September 02, 2024 @12:10PM (#41426615)
NPM’s original sin was making package installation and general management so painless that folks installed micro packages for everything. Can’t really fault the software for that.

The issue was, as you say, the introduction of ESM. It used to be that you required modules one way and one way only (yes there was AMD for advanced use cases, but it was an add-on), then people felt the need to “standardize” that, no we have this mess of ESM and CJS.

Re:Escaping from Anaconda's Stranglehold on macOS by jampekka on Monday September 02, 2024 @05:20PM (#41428910)
I don't see what's wrong with micropackages.
Re:Escaping from Anaconda's Stranglehold on macOS by VHRanger on Monday September 02, 2024 @09:13PM (#41430236)
Massive attack surface. That's true as a security risk, but also as a dependency risk (eg. left-pad).
Re:Escaping from Anaconda's Stranglehold on macOS by dumbo-octopus on Tuesday September 03, 2024 @05:34AM (#41433047)
If you don’t vendor your dependencies. Which is a poor practice that is commonly associated with NPM, but is by no means a requirement of the technology.
Re:Escaping from Anaconda's Stranglehold on macOS by dumbo-octopus on Tuesday September 03, 2024 @05:46AM (#41433114)
Especially if…, I should say. Even vendored dependencies are a risk as NPM commits the additional sin of allowing the act of pulling a package onto the local machine for inspection to execute arbitrary code in the form of “postinstall” hooks.
Re:Escaping from Anaconda's Stranglehold on macOS by jampekka on Tuesday September 03, 2024 @06:35AM (#41433401)
Review and pin your direct dependencies. With transitive dependencies it doesn't differ from trusting large dependencies in general.

The alternative to micropackages has significant downsides. Pulling in extra surface and rolling your own buggy implementations while waiting for some commitee to bikeshed years on the implementation.

Making the right thing easy rather than the wrong thing hard is a lot better approach.

Re:Escaping from Anaconda's Stranglehold on macOS by dvdkon on Monday September 02, 2024 @04:42AM (#41423682)
I actually like Python's package management (with just pip and venv). It's different to all other modern solutions, taking a per-shell rather than per-project approach, but that doesn't mean worse.

The advantage is that it's less "magic" than, say, npm. No need for rules saying how to find node_modules, you just have a PYTHONPATH env variable.

The Rust and Java approach is to do everything through a build tool's CLI, and I can't complain about that. It's probably the best compromise: Less magic than npm, and more user-friendly than Python.

Re:Escaping from Anaconda's Stranglehold on macOS by jampekka on Monday September 02, 2024 @06:29AM (#41424206)
What magic is there for finding node_modules? It's in the same directory as package.json. Very similar (though simpler) to how Python modules work.

There's also usually one global package dir, but that's almost exclusively used for runnable binaries, and not even really needed when there's npx.

If you think Python packaging has less magic, you probably don't know it very deeply.

I lost all hope for Python package management to ever get better when PEP 582 got rejected for some stupid tribal reasons.

https://peps.python.org/pep-0582/

Re:Escaping from Anaconda's Stranglehold on macOS by dvdkon on Monday September 02, 2024 @07:08AM (#41424372)
I was talking more about the package lookup when running code, via e.g. `node script.js`. I think it looks in all parent directories of the CWD, or maybe of the script? It's not too complicated, but it is "more magic" IMO.

Actually building Python packages is pretty complex, but that's the case for JS too. Java avoids this by distributing compiled libraries.

Re:Escaping from Anaconda's Stranglehold on macOS by jampekka on Monday September 02, 2024 @07:24AM (#41424447)
It looks up from script.js'd directory or the earliest parent with node_modules. Not CWD. A lot like "import somemodule" in script.py tries to import somemodule.py file from the directory script.py is in.

Traversing to the parent is especially nice for scripts. In python having scripts outside the module directory is quite painful.

Gyp is a lot easier than Python setup.py. The "easy" Java packages are comparable to pure Python/pure JS packages. With e.g. C bindings JNI/Java packaging is a horrid pain.

Re:Escaping from Anaconda's Stranglehold on macOS by LarsDu88 on Monday September 02, 2024 @12:03AM (#41422474)