4 ms·
Python is such a mess, most likely the script you wrote won't work on a coworker's machine. Either it accidentally needs some global package installed, and then
by matsemann 5y ago
Python is such a mess, most likely the script you wrote won't work on a coworker's machine. Either it accidentally needs some global package installed, and then if course the needed version interfers with something else. Or the script only works for certain versions of python etc.
For most of our big scripts at work, I've actually resorted to just running them inside a docker container, mounting my current folder. So tired of trying to get my env to match someone else's.
- jollybean 5y agoIt just blows my mind that this, and some of the other idiosyncracies of Python are not sorted out. Python3 was a big stain because of those issues. Python 4 could literally just be a platform shift to sort out paths, libraries, dependencies, documentation in order to try to solve all those problems. It's just amazing how nutty things can be for tech we all depend on. We would have never designed something that way on purpose. Bash - as a non-expert I also feel is a bit wierd. I almost what Computer Science God to come along and make a shell script, a clean light language like python/js, maybe something like Swift/Java, and then something like Rust but a bit easier - and they all feel a bit similar and integrate and the build tooling is fairly clean and the whole world can get along.
- mwaitjmp 5y agoIf you don’t feel comfortable writing shell scripts, or even for people who do :-), shellcheck especially when used as a vscode plugin will hold your hand and catch any potential problems with your shell script before it’s even run.
- jollybean 5y agoThe problem is not me, the problem is Bash.
- danmur 5y agoIt's definitely a pain not knowing if your python3 is 3.5, 3.6, or later. If you stick to using the older syntax and standard library, though, it's a fairly reliable replacement for bash. Though, in my situation the environments are pretty tightly controlled, so maybe I've got a biased set of experiences.
- andresgaitan 5y ago>>Python is such a mess, most likely the script you wrote won't work on a coworker's machine. Either it accidentally needs some global package installed, and then if course the needed version interfers with something else. Or the script only works for certain versions of python etc. So true. You have to be very careful when writing python, because cool language idioms that you use (or function calls), may not have been introduced in say for example Python 3.5. So when someone runs it with a different interpreter it will not work. Writing python scripts that not-python-knowing people could use, is an art. Instead, I work for a company who's core was written in bash and perl, and those scripts still work today after 15 years.
- barnabee 5y agoI would use Python much less often if it weren’t for Poetry [1], but with it I’ve never had a colleague fail to get a script running. [1] https://python-poetry.org/ https://python-poetry.org/
- matsemann 5y agoHave problems with poetry all the time. Upgrade minor version of python, suddenly there is no wheel available for some combination of platform+architecture. Forces you to build the stuff yourself, thus having to install a complete cpp build chain.
- barnabee 5y agoI haven’t come across this but I use only whatever versions of Python are provided by the python@3.10 and/or python@3.9 Homebrew packages and Debian testing or stable so am very likely not at the bleeding edge. That or I don’t have interesting enough dependencies :)
- deleted 5y ago[deleted]
- mwaitjmp 5y agoI completely feel your pain, however check out poetry. Package management and a virtual env manager in one.
- d0mine 5y agoThere are legitimate issues but in most cases I encountered, the complaints are of the kind: "it doesn't behave exactly like solution from another language that I happened to learn first and therefore Python sucks. What is the dependency management solution for bash that it so much better than anything in Python?
- matsemann 5y agoProbably none. So the problem is really that so many brittle scripts get passed around, instead of either making it selfcontained on containerized.