4 ms·
Well I started with pip because it's what I was told to use. But it was slow and had footguns. And then I started using virtualenv, but that only solved part of
by bastawhiz 1y ago
Well I started with pip because it's what I was told to use. But it was slow and had footguns. And then I started using virtualenv, but that only solved part of the problem. So I switched to conda, which sometimes worked but wrecked my shell profile and often leads to things mysteriously using the wrong version of a package. So someone told me to use pipenv, which was great until it was abandoned and picked up by someone who routinely broke the latest published version. So someone told me to use poetry, but it became unusably slow. So I switched back to pip with the built-in venv, but now I have the and problems I had before, with fewer features. So I switched to uv, because it actually worked. But the dependency I need is built and packaged differently for different operating systems and flavor of GPU, and now my coworkers can't get the project to install on their laptops.
I'm so glad all the Python packaging challenges are "solved"
- aledalgrande 1y agoMan I used python sparingly over the years and I still had to deal with all those package manager changes. Worse than the JS bundling almost?
- seriocomic 1y agoI've walked the same rocky path and have the bleeding feet to show for it! My problem is that now my packaging/environment mental model is so muddled I frequently mix up the commands...
- anothernewdude 1y agoI felt like python packaging was more or less fine, right up until pip started to warn me that I couldn't globally install packages anymore. So I need to make a billion venvs to install the same ml, plotting libraries and dependencies, that I don't want in a requirements.txt for the project. I just want packaging to fuck off and leave me alone. Changes here are always bad, because they're changes.
- tayo42 1y agoYou can turn that off and allow global packages again if you want. Or install it with the os package manager or something simmilar
- x3n0ph3n3 1y agoYou assume the OS package manager I happen to be using even has packages for some of the libraries I want to use.
- 0x6c6f6c 1y agoNothing about their post indicated they assumed that. They offered two options, so you can go do the other one if it doesn't work for you.
- sieabahlpark 1y ago[dead]
- yxhuvud 1y agoOr for that matter, that the ones they do have are compatible with packages that comes from other places. I've seen language libraries be restructured when OS packagers got hold of them. That wasn't pretty.
- bastawhiz 1y agoI'd otherwise agree but this problem seems unique to Python. I don't have problems like this with npm or composer or rubygems. Or at least very infrequently. It's almost every time I need to update dependencies or install on a new machine that the Python ecosystem decides I'm not worthy.
- frollogaston 1y agoEven the way you import packages is kinda wack
- Eduard 1y agoI started with "sudo apt install python" a long time ago and this installed python2. This was during the decades-long transition from python2 to python3, so half the programs didn't work so I installed python3 via "sudo apt install python3". Of course now I had to switch between python2 and python3 depending on the program I wanted to run, that's why Debian/Ubuntu had "sudo update-alternatives --config python" for managing the symlink for "python" to either python2 or python3. But shortly after that, python3-based applications also didn't want to start with python3, because apt installed python3.4, but Python developers want to use the latest new features offered by python3.5 . Luckily, Debian/Ubuntu provided python3.5 in their backports/updates repositories. So for a couple of weeks things sort of worked, but then python3.7 was released, which definitely was too fresh for being offered in the OS distribution repositories, but thanks to the deadsnakes PPA, I could obtain a fourth-party build by fiddling with some PPA commands or adding some entries of debatable provenance to /etc/apt/lists.conf. So now I could get python3.7 via "sudo apt install python3.7". All went well again. Until some time later when I updated Home Assistant to its latest monthly release, which broke my installation, because the Home Assistant devs love the latest python3.8 features. And because python3.8 wasn't provided anymore in the deadsnakes PPA for my Ubuntu version, I had to look for a new alternative. Building python from source never worked, but thank heavens there is this new thing called pyenv (cf. pyenv), and with some luck as well as spending a weekend for understanding the differences between pyenv, pyvenv, venv, virtualenv (a.k.a. python-virtualenv), and pyenv-virtualenv, Home Assistant started up again. This wall of text is an abridged excursion of my installing-python-on-Linux experience. There is also my installing-python-on-Windows experience, which includes: official installer (exe or msi?) from python.org; some Windows-provided system application python, installable by setting a checkbox in Windows's system properties; NuGet, winget, Microsoft Store Python; WSL, WSL2; anaconda, conda, miniconda; WinPython...
- voicedYoda 1y agoYou forgot the wheels and eggs
- smellf 1y agoYou can have my `easy_install` when you pry it from my cold dead fingers.
- integralid 1y agoWhat's wrong with just using virtualenv. I never used anything else, and I never felt the need to. Maybe it's not as shipping l shiny as the other tools, but it just works.
- joshvm 1y agoNothing is inherently wrong with virtualenv. All these tools make virtual environments and offer some way to manage them. But virtualenv doesn't solve the problem of dependency management.
- rcleveng 1y agoThe problem is you can do whatever you want in it, and then have no way of reproducing that. pyproject.toml tries to fix it, poetry kept wanting to use their own wonky names for the tags, I'm not sure why. Once that is standardized, venvs should be cattle and not pets. That is all that is needed. UV makes that fast by hardlinking in the libraries and telling you the obvoius (that venvs should be cattle and not pets) This fight was poetry's to loose.
- bootsmann 1y agoI think poetry “lost” because they had to build ahead of the PEPs that standardized their way of doing things. I don’t think uv could exist without the work the poetry people put in, it served as a pretty powerful demonstration of the fact that better python packaging was possible.
- deleted 1y ago[deleted]
- divbzero 1y agoThere’s nothing wrong with just using virtualenv. I too have used virtualenv plus pip (and sometimes pyenv) for the longest time without issue. However, uv is the first alternative that has tempted me to switch. uv offers performance improvements over pip and handles pyenv use cases as well. I’ll be paying attention to pyx to see how it pans out.
- arkh 1y agoComing from the php ecosystem this kind of package manager problems feels crazy. Maybe Python and js people should just use composer too.
- hargup 1y agoJS packaging ecosystem is fairly mature compared to python. The install and deps issues way fewer.
- exasperaited 1y agoIt is hilarious how Composer went from "haha, PHP has a package manager now, bless their hearts" to "why can't it work like Composer?" I don't think PHP is perfect by any means but I don't dread using Composer, even in contexts like WP plugins where it is definitely not a "native" technology.
- btreecat 1y ago> But the dependency I need is built and packaged differently for different operating systems and flavor of GPU, and now my coworkers can't get the project to install on their laptops. This is why containers are great IMO. It's meant to solve the problem of "well it works on my machine"
- frollogaston 1y agoYeah but it's also nice not having to rely on a container for stuff to work at all, especially when you're doing development.
- btreecat 1y agoWhile I can dev in a container, I don't enjoy the XP nearly as much due to the current state of tooling re remote debuggers. I do ship containers as a top level .exe equivalent.
- yulyavaluy 1y agoWe actually built a platform that eliminates all these steps, you can now reproduce GitHub repos with 0 manual config in 60% cases. check for more info on https://x.com/KeploreAI https://x.com/KeploreAI We just launched it and waiting for first users to be astonished :), let me know if you have any questions
- deleted 1y ago[deleted]