4 ms·
> The one big problem it has is that it keeps changing What prevents you from using an old Python version?
by Elucalidavah 2y ago
> The one big problem it has is that it keeps changing
What prevents you from using an old Python version?
- dijit 2y agoUsually us plebs use the system python. With no python version manager (I don’t even know any off the top of my head). Also virtualenvs only get you so far, I’ve come back to many projects on my machine with broken virtualenvs, I guess due to some dynamically linked dependency of python that my system no longer has. :(
- ok_dad 2y ago> With no python version manager (I don’t even know any off the top of my head) Try a tool called `pyenv`. It's pretty great. I pair it with the package manager called `poetry`.
- Joeboy 2y agoOr https://github.com/astral-sh/uv https://github.com/astral-sh/uv can replace both. Various features are tagged as "experimental", and I guess the api might change, but it seems to work already. I have high hopes for it eventually making python's fragmented package management issues go away. Edit: Somebody's going to respond with the XKCD aren't they? I know about the XKCD and I nevertheless have high hopes for `uv`.
- Izkata 2y agoLooks like pyenv does the same thing as asdf, except only for python. https://github.com/asdf-vm/asdf https://github.com/asdf-vm/asdf And here's a list of everything it supports: https://github.com/asdf-vm/asdf-plugins/tree/master/plugins https://github.com/asdf-vm/asdf-plugins/tree/master/plugins
- jashmatthews 2y agoIt's the sledgehammer approach but... Docker?
- wakawaka28 2y agoUsing an old Python version means you're stuck using libraries that work with that version. I think you have to figure out which ones work on your own as well.
- scrollaway 2y agoBecause libraries also change, for the same reason as python changes: To keep up with compatibility of newer devices, systems, and usage patterns. Beside, "figure out which ones work" is a solved issue with a package manager such as poetry.
- rowanG077 2y agoThat is if all libraries were super stringent in their dependency bounds. Which in my experience no one is. So it's a crapshoot if it will work or not.
- SOLAR_FIELDS 2y agoThis is more of an indictment on how bad Python is about mixing system level packages with library dependencies than anything else. The classic example I always give is psycopg2 depending on a system install of Postgres client library.
- imtringued 2y agoThe irritating thing about python is that since it is mostly glue around C, all the annoying things about C leak through.
- wakawaka28 2y agoIt's not a solved issue, as others have pointed out. To elaborate, most packages are not maintained continuously. Some don't get updates anymore and some get updates that break older versions of Python. The authors of these libraries definitely aren't rooting out all the problems that can occur due to mismatched versions. And when you change one library, any other related library can be affected. It's like solving a puzzle sometimes. In many cases people throw up their hands and say "forget this, I'm not upgrading anything!" This is also the big driver of solutions like virtualenv and Docker. All languages have this issue to some extent but Python breaks stuff more often than anything else I use. I don't especially like language-specific package downloaders either but that's not a Python-only problem, and there are tradeoffs to pushing the work downstream into more stable systems.
- CJefferson 2y agoI'd love to stick with python 2.7 forever, but it isn't getting even minor updates just to keep up to date with operating system updates, and is starting to stop being packaged. My current solution is a docker container which includes python 2.7 and a downloaded copy of every package I use.
- etrautmann 2y agoWhat do you prefer about it?
- nlitened 2y agoThat it has a lot of my old code working perfectly for years, and I don't have spare time to port it to another language and keep catching subtle bugs for months.
- rglullis 2y agoOut of curiosity, how many lines of code are we talking about here?
- imtringued 2y ago"Port it to another language". You're saying this as if the minor asinine breaks in python 2 Vs 3 make it a whole new programming language, when in reality it is mostly bullshit like print going from statement to function.
- CJefferson 2y agoMy problem is some libraries which never transitioned from 2 to 3. I don't want to try to convert them, particularly as they involve Unicode which is one of the hardest bits to get right in my experience.
- skeledrew 2y agoImproved unicode (string vs byte separation) handling was exactly one of the larger reasons for the breaking change to 3.
- guappa 2y ago> What prevents you from using an old Python version? I think the fact that it's not on the distributions is a major factor here.
- mort96 2y agoBeing able to use the system's Python (or in the case of macOS, Homebrew's Python) is extremely convenient. Especially when Python is used as a language for build scripts across a team. I'm not interested in forking Python taking on the responsibility of maintaining, packaging and distributing Python across a range of platforms.