Hacker News new | past | comments | ask | show | jobs | submit login

Python packaging is really bad.

These days I just use virtualenv since at least it's simple to use and reason about. It's bad, just not nearly as bad as the others I've tried.




You might like Relieving your Python packaging pain [1]. The article seems to come to a similar conclusion as you do.

[1]: https://www.bitecode.dev/p/relieving-your-python-packaging-p...


Indeed. I'm not too fussed about points 1 and 2. I will install whatever version works for me, usually via Homebrew.

Otherwise, sound advice.


Why is venv bad though?


Compare to something like node_modules for the equivalent functionality.

Trivial to rellocate: just move the folder.

Trivial to delete: just delete the folder.

Trivial to do something more complex, with layers of dependencies, custom not local path, etc.


You can certainly just delete a venv. `rf -rf venv`

I'm not sure what kind of custom path you need, but you can put a venv anywhere you want that's practical.

Yes, when you create it, you need leave it there. but they're trivial to create. `python3 -m venv [path to venv]` Installing packages is a LOT faster than npm.

There's definitely issues with python's setup as a global interpreter, but these arn't them.


You should be able to copy paste the folder across identical machines. Now it's not recommended for... reasons.


Why would you do that? I wouldn't do that with node_modules either.

If they're 100% cloned VMs or something, I guess? I'd still probably just build wheels and use those.


> Why would you do that?

I hate this question. It's basically "why are you stupid"? I'm a professional with 20 years of experience with ecosystems ranging from Java, .NET, Ruby, Python, etc., so if I write something, I probably have a valid use case.

The opposite question should be asked: why can't I do that?

And the answer is, frankly, either lazy/bad design on the Python ecosystem part or backwards compatibility with an existing but bad system. In a well designed system venvs would be by default copy-able to another equivalent system since there's little to lose and a lot to gain, for example, access to the simplest and most reliable deployment system invented in history, the <<copy-paste deployment system>>.

The fact that we have entire generations of developers that can't fathom why someone would want that basically says all it needs to say about the degree of over engineering that's now standard.


> Why would you do that?

Deployment, sharing for development, etc.


poetry is awesome. i recommend it


It won't install tensorfow on a Mac Mx series without hacking a custom config. I gave up on Poetry after that and try to stick with pip now.


I've not had this problem.


Poetry install tensorflow does not work for me. There's lots of other folks with this issue as well.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: