3 ms·
I have never really understood how Python dependency management got broken in the first place. The basic model is the same as the basic Unix shell model: you ha
by pdonis 6y ago
I have never really understood how Python dependency management got broken in the first place. The basic model is the same as the basic Unix shell model: you have a path, which is just a list of places where executable thingies can be found, and whatever wants to execute the thingies looks in each place in the list, in order, until it finds the thingie it wants, or it bails out with an error if it's gone through the entire list and can't find what it's looking for. In a Unix shell, the list is $PATH (or maybe $LD_LIBRARY_PATH, since most Python dependencies are libraries); in Python, it's sys.path. Installation of an executable thingie then is simply a matter of "make sure this ends up in one of the places listed in the path". What is so hard about this?
- misnome 6y agoWhat about different packages with different version dependencies?
- brendawalsh 6y agoSo, my most recent success has been using pyenv and pipenv. I install pyenv first, then install any specific point releases I need, then switch to the python version I want to use, and then use pipenv to install dependencies or run commands in the virtual environment.
- zelphirkalt 6y agoI think lately pipenv also interacts with pyenv to do this automatically.
- pdonis 6y agoVersion numbering and labeling of the packages--the same way Unix solves the same problem with shared libraries. A program that wants a specific version of a library looks for it by specific version.