3 ms·
Pip doesn’t really work. That is, it works sometimes, but instead of getting a global view of the different versions of dependencies, it just starts downloadin
by PaulHoule 3y ago
Pip doesn’t really work. That is, it works sometimes, but instead of getting a global view of the different versions of dependencies, it just starts downloading and installing things and it can get itself stuck in a corner.
Some developers use pip all the time. I have some little projects that I do in PyCharm and I add packages with the IDE which uses pip and it is fine.
I worked at a place where our projects were pretty complicated and pip could not solve them consistently.
My RSS reader YOShInOn uses conda for package management because CUDA “just works” with conda plus you get numpy and the like compiled against the MKL libraries for a nice boost. Conda is slower than it should be, I think it was a serious mistake that they compress packages with BZ2 (I had a system that even installed a local copy of all the CUDA libs with conda packages I made but decompression just takes forever.). Still, the solver is logically sound.
The worst problem of it is that the packages you want might not be in conda, you can get away with pipping in a package or two but long term that’s the road to ruin. If you do want to use packages that aren’t in conda your beat way forward is to build conda packages for them which is usually not hard —- to really get control of the build of any egg packages you need to make wheels out of them anyway which is basically the same.
It is a little ugly but YOShInon has a sidecar application which doesn’t have any machine learning in it but instead links the mastodon API client and other things that aren’t in conda so YOShInOn just runs that executable when it wants to post to Mastodon.
- jzombie 3y agoIt's too bad that there are multiple package managers for Python that all have different approaches, but it is nice that there are at least ways around that, as you've mentioned (just seems like a lot of complexity to do something that seems like it should be easy; installing/upgrading/removing packages).
- PaulHoule 3y agoWell... It's a slightly more complex problem than you might think it is. For instance, installing "just one more" package might involve changing the dependency which is not compatible with another dependency that was chosen, it might be possible to change that dependency to a compatible version, but half-baked tools like "pip" frequently die in this situation. Python's problem has been that the community has been too tolerant of solutions that are 90% correct, confusing that with "has 90% of the features somebody might want". There's nothing more time-consuming and expensive than working with code that is incorrect... I mean, the value of a sort routine that works 90% of the time is not 90% of the value of one that works all the time, but 0%. To save 15 minutes of thinking, some people will spend 15 years pushing a bubble around under a rug. A lot of people are really disgusted with Python because of these kind of problems, in fact the place where we were struggling with Python builds didn't share my faith that the problems could be solved and gave up on the project. Like this quote https://www.npr.org/sections/itsallpolitics/2013/10/28/241295755/a-churchill-quote-that-u-s-politicians-will-never-surrender https://www.npr.org/sections/itsallpolitics/2013/10/28/24129... however, Python really does do the right thing in the end and I'm quite excited that pypi is now publishing the dependency lists separate from the rest of the wheel because that's a key item for a correct solver because you really want all of that info to make the right decision. Back in the Datalogue era I had found that you can fake this because wheels are really ZIP files and you can read a file inside a ZIP file with at most three partial http requests. Similarly you really have to stamp out eggs because you can't know what they depend on without running the setup.py. Given that the foundational changes have been made it is just a matter of time before we see a package solver for Python that is 100% correct like the solver for Maven.
- gjvc 3y agoplease stop spreading this FUD
- PaulHoule 3y agoYou know the Jehovah's Witnesses came to my door the other day and told us that we shouldn't read anything about them online except their official web site. I am still using Python for my personal projects, something I wouldn't do if I didn't think Python was worthwhile. I've seen a lot of people who've been burned and won't come back. If we're not going to be honest about problems people are going to keep getting burned and keep leaving.
- gjvc 3y agoNo need to be sarcastic-by-allegory. Are you using `pip freeze` / `pip list --format=freeze` to capture the state of a working environment? What size system are you working on that you get into difficulties in upgrading a subset of project dependencies? It's often easier to upgrade by re-capturing the currently-contemporaneous set of dependencies, (and then diffing the new output of `pip freeze` with the previous one to see what's changed), than it is to manually follow the dependency graph when updating a single component. As always, YMMV.