Live data from Hacker News

Thoughts on the Python packaging ecosystem

pradyunsg.me

51–60 of 121 posts

Re: Thoughts on the Python packaging ecosystem

#51

For me, before I even get to packaging, I hit the install/environment issue with python. Python, by default, wants to be installed at a system level and wants libraries/packages to be at a system level. That shit has to stop. The default needs to be project local installs. Node might have issues but one thing they got right is defaulting to project local installs vs python where you need various incantations to get o…

The Debian dist-packages/site-packages mechanism alleviates a lot of the problems with dependency hell and clobbering from packages needing to be installed. It's a shame it hasn't been embraced by mainline Python. A case of perfect being the enemy of good. Instead we get the chaos of pyproject as the next great thing.

Re: Thoughts on the Python packaging ecosystem

#52

Asking as a complete newcomer to Python programming... Why doesn't somebody just fix pip? Or is pipenv just understood to be the fix?

Second that. Pip has been the default for more than a decade. And yes it does have issues. Why not fix it or add options to pip instead of piling on more tools?

Re: Thoughts on the Python packaging ecosystem

#53

For me, before I even get to packaging, I hit the install/environment issue with python. Python, by default, wants to be installed at a system level and wants libraries/packages to be at a system level. That shit has to stop. The default needs to be project local installs. Node might have issues but one thing they got right is defaulting to project local installs vs python where you need various incantations to get o…

Lucky for you, there's a new PEP proposing just that: https://discuss.python.org/t/pep-704-require-virtual-environ... Written by the author of this blog post no less! However, you'll find that as with all packaging discussions there are people opposing it, because their workflow doesn't match yours and they don't want to change how they work. We, as a community, need a way to resolve such stalemates or I fear we won'…

We need some person, a nice person, a benevolent person, who could some how tell other people what to do, dictate it if you will, and it would be best if they could keep up this job for the rest of his or her life. We’ll call them, the Friendly Language Uncle.

Re: Thoughts on the Python packaging ecosystem

#54

For me, before I even get to packaging, I hit the install/environment issue with python. Python, by default, wants to be installed at a system level and wants libraries/packages to be at a system level. That shit has to stop. The default needs to be project local installs. Node might have issues but one thing they got right is defaulting to project local installs vs python where you need various incantations to get o…

You can do this now by creating a Python virtual environment[0]. Then you can package your project with a requirements file and some instructions on its use. I use Python VENV often, and it works really well.

[0] https://realpython.com/python-virtual-environments-a-primer/

Re: Thoughts on the Python packaging ecosystem

#55

Asking as a complete newcomer to Python programming... Why doesn't somebody just fix pip? Or is pipenv just understood to be the fix?

Second that. Pip has been the default for more than a decade. And yes it does have issues. Why not fix it or add options to pip instead of piling on more tools?

Because for whatever reason Python really attracts the Start Over And This Time We’ll Get It Right crowd. It’s why I don’t start new projects with it anymore, but make most of my living cleaning up the mess that incompatible changes make with existing software. So, in that sense, it’s great for keeping devops employed.

Re: Thoughts on the Python packaging ecosystem

#56
post #36

Earlier quoted context omitted.

To me the natural choice would be pip which, as OP points out, has the advantage of shipping with Python by default. We could remedy the shortcomings of pip by incorporating the most successful features from the N alternatives that exist today. The npm / yarn fork that formed in 2016 is the closest analogy I can think of. My impression is that npm improved on its biggest weaknesses ( e.g. a lock file) and has remaine…

To some extend. NPM is still (even after all the improvements) the weakest of the package managers. There’s no doubt it’s the default though.

[deleted]

Re: Thoughts on the Python packaging ecosystem

#57

Why does Ruby not have similar problems? (Or if it does, why does nobody seem to care?) Like why does Ruby have gem and bundler, each doing one thing, whereas python has fifty bazillion tools that all do nearly the same thing if you squint but all have their own weird problems? I've personally just ended up using poetry and that has mostly stopped me from having to care overmuch about the tooling. I feel like I'm spo…

Not a Ruby guy, but my feeling is that C extensions are more rare in that ecosystem. The majority of the Python woes feel directed at the proper way to package and compile non-Python code.

It is not rare. One of the most popular gems - nokogiri (in the top 10 typically https://rubygems.org/releases/popular) has C extension.

Nokogiri was historically a bit difficult to install but that was because of dependencies and not packaging. To overcome that limitation, nokogiri now has prebuilt binaries for most platforms.

Packaging in ruby using bundler is amazing. It also evolved naturally. In the beginning there was only `gem install`. Then came `bundler` with package list and lock files. It had widespread adoption and now it is shipped with ruby.

Re: Thoughts on the Python packaging ecosystem

#59

Earlier quoted context omitted.

Python's demise would be it's undeserving fate to be the world's best "glue" language. The language needs to stand on it's own to be competitive in the long run. Pure Python modules are much easier to install and keep updated.

It will be a VERY deserving fate, since the community is always busy fighting amongst themselves and the maintainers are conservative to the point of being unreasonable. Maybe such a community deserves obscurity. Python has real problems that need addressing, and that was true 10 years ago as well, packaging included. Pretending this isn't the case makes more serious techies just laugh at Python, and it's fully deser…

I have seen recent predictions that put Python as the main AI language in 2030 with 90% confidence. It's not dead or going away.

Python also works better in Codex and chatGPT, as an output of AI. Almost all AI research comes in Python, most of it never gets reimplemented, and the cutting edge stuff are usually just in Python. So if you want to try the latest toys - you guessed it - you need Python. Or be prepared to wait for 6-12 months/forever to get ported to your lang, and be prepared for bugs and less support

AI is going to be a differentiator for programming languages. The languages with more code out there, more questions answered on SO, will work better, causing more adoption, it's the rich get richer problem.

Re: Thoughts on the Python packaging ecosystem

#60
post #59

Earlier quoted context omitted.

It will be a VERY deserving fate, since the community is always busy fighting amongst themselves and the maintainers are conservative to the point of being unreasonable. Maybe such a community deserves obscurity. Python has real problems that need addressing, and that was true 10 years ago as well, packaging included. Pretending this isn't the case makes more serious techies just laugh at Python, and it's fully deser…

I have seen recent predictions that put Python as the main AI language in 2030 with 90% confidence. It's not dead or going away. Python also works better in Codex and chatGPT, as an output of AI. Almost all AI research comes in Python, most of it never gets reimplemented, and the cutting edge stuff are usually just in Python. So if you want to try the latest toys - you guessed it - you need Python. Or be prepared to…

I believe you're misrepresenting what I said.

I got no horse in the race and I don't care if Python is "going away". It likely will not since it has a huge inertia and devoted fans.

Furthermore, you citing the current state of affairs is not convincing. You're basically saying "the sun is shining now at noon, surely it will keep shining during midnight". Or "right now it's raining so surely it'll keep raining 24/7 for the next year".

Also who predicts stuff for 2030 with 90% confidence? I'd like to have that person's self-esteem because nobody can predict as far into the future.

I've been part of a number of communities and Python's seems dysfunctional and anarchic.

Maybe that's a good thing and breeds creative forces -- the proponents certainly make that case, I heard, and I'm not opposed to the idea, just a tad skeptical. Time will tell, right?

In the meantime, Python is still missing some stability guarantees and a good package manager. As a programmer that's a turnoff, so I work with other languages. Make of that what you will but I'll restate that I got no horse in the race. I'm using my experience to judge if something seems a good fit to work with, and maybe -- does it have a future.

Post reply on HN