Live data from Hacker News

Escaping from Anaconda's Stranglehold on macOS

paulromer.net

211–220 of 286 posts

Re: Escaping from Anaconda's Stranglehold on macOS

#211
post #155

I appreciate all the comments. I agree with most, even when they disagree with me or each other. I especially agree with the questions several people raise: What it is that we should teach? In which order? I think there is a consensus about what a student should end up knowing. Even if they are not going to become developers, they should be able to edit text files; they should be able to run commands from the termina…

I agree with most of your "Environment as Code" post. Virtual environments are overhyped and even experienced developers frequently have to fix their venv or repair their conda install. You get to depend on a tool that's not necessary and distracts from the original purpose of using the software.

On Unix, it is even trivial to have parallel installations.

Build two pythons:

  ./configure --prefix=/home/foo/a && make && make install
  make distclean
  ./configure --prefix=/home/foo/b && make && make install
Install packages:

  /home/foo/a/bin/python -m pip install bar
  /home/foo/b/bin/python -m pip install quux
This is completely isolated. You can do the same by using the Windows installer to install to different directories. If an installation breaks, remove it and reinstall.

My experience is that people who recommend various environment software often like strict bureaucratic procedures, or have a financial interest in pushing the software or are simply not experienced and do what they are told.

Re: Escaping from Anaconda's Stranglehold on macOS

#212
post #108

Contrast the python experience with R, MATLAB, Mathematica, (even Julia). That should be what python ecosystem should aspire to. Blaming students for not understanding command line, virtual env, package management versioning etc.. and screwing around with magic incantations (to them) is just a sad reflection of how unfriendly this frankensystem is. Doubly sad that python is the default way to learn anything nowadays.

Python's package management isn't great, but at least it exists. R is absolutely awful in this regard, 99% of packages don't even specify versions for their dependencies.

Try installing a specific version of an R package from more than 2 years ago, it's an exercise in frustration,

Re: Escaping from Anaconda's Stranglehold on macOS

#213
post #176

Earlier quoted context omitted.

I don't see how it could be correct to say that I'm recommending that students pip install into the system Python. On macOS, there hasn't been a system Python since 12.3 came out in Jan of 2022. And as far as I know, there was never a system Python on Windows.

> On macOS, there hasn't been a system Python since 12.3 came out in Jan of 2022 It may not be pre-installed, but if you install Xcode it will also install python3 in /usr/bin/ for you...

Xcode users should probably be able to fix breakage and that /usr/bin/python is not used by MacOS for critical tasks.

Re: Escaping from Anaconda's Stranglehold on macOS

#214
post #205

Earlier quoted context omitted.

Python has dogshit package management that makes java look well thought out and sane.

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,…

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

#215
post #193

Earlier quoted context omitted.

Python has dogshit package management that makes java look well thought out and sane.

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...

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

#216

Earlier quoted context omitted.

Python has dogshit package management that makes java look well thought out and sane.

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…

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

#217
post #3

This seems like a lot of work to bypass something in the zshrc file vs. doing something in a terminal emulator? I would assume Python developers are somewhat forced to use a command line anyway.

Seems a complete farce to learn Python without learning how environments work seen as the way it's designed it's impossible to use for more than a single project without them.

Re: Escaping from Anaconda's Stranglehold on macOS

#218
post #169

Earlier quoted context omitted.

IMO what needs to happen is python needs to get rid of system installs and only work via venv. It should check the current folder for some .venv or something and auto-config itself to the current directory (or complain that you need to config with a messages like "python not configured for current folder. Run 'source bin/activate' to configure. Honestly thought that could be so much better. The entire problem of pyth…

Python developers agree. See PEP 668 – Marking Python base environments as “externally managed” – https://peps.python.org/pep-0668/

Yet another hack on hack. Venv was the wrong fix/hack and now the package management is cascading into even more madness.

Re: Escaping from Anaconda's Stranglehold on macOS

#219

Earlier quoted context omitted.

I have been out of the loop with Python for a couple years at this point, but how could this get so bad? If you are looking into a system you are unfamiliar with, where do you look first?... pip? pipx? homebrew?... or is it in anaconda? pyenv?... must be in the os package manager... apt? pacman? Honestly, Maven and NPM look great compared to this mess.

NPM to me is the great example of a package manager that worse than anything the Python community has come up with, but that's subjective I think. Python isn't as bad as people make it out to be. There are some issue that you will run into if your project/code base becomes really large, but that's not an issue for most people. The vast majority can get just use python -mvenv .venv to set up a virtual environment and…

What's your problem with NPM? It just works, it's easy to package for, it handles multiple version dependencies elegantly, with pnpm it doesn't trash your disk and is really fast.

(P)NPM and CJS is the best package/dependency management there currently is.

Re: Escaping from Anaconda's Stranglehold on macOS

#220
post #205

Earlier quoted context omitted.

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,…

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 man…

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.

Post reply on HN