3 ms·
A tool that checks your broken python/pip install and fixes it properly. https://xkcd.com/1987/ https://xkcd.com/1987/
by moffkalast 5y ago
A tool that checks your broken python/pip install and fixes it properly.
https://xkcd.com/1987/ https://xkcd.com/1987/
- sdflhasjd 5y agoI was just setting up a new Mac the other day, only to be surprised that this is _still_ an issue. All I had was XCode and Homebrew - everything fell apart when I tried to install ansible.
- NavinF 5y agoThere’s no solution. You gotta have a separate environment (e.g. a docker container) for each project. Each env has its own python version and requirements.txt
- moffkalast 5y agoNot practical when you need something like ROS with rospy that needs to be global. Python is putting its fingers in its ears singing "LALALALA USE A VENV" instead of fixing the damn ecosystem. Node and npm proved that a solution exists and it's doable.
- CrispinS 5y agoThere's a PEP for adding support for a __pythonpackages__ directory, similar to node_modules. https://peps.python.org/pep-0582/ https://peps.python.org/pep-0582/ Unfortunately the PEP is from 2018 and is still being discussed. The last post in the comment thread is from February. https://discuss.python.org/t/pep-582-python-local-packages-directory/963/134 https://discuss.python.org/t/pep-582-python-local-packages-d... That's unfortunate; until I went looking for citations I thought it was further along and actually scheduled for the next Python release. Looks like there is a pip-alternative that implements the PEP, but I haven't played around with it yet. https://pdm.fming.dev/ https://pdm.fming.dev/
- kretaceous 5y agoThrowback to the time when I accidentally did a `sudo apt remove python` in hopes of cleaning the python mess in my PC and broke my LM installation.
- moffkalast 5y agoApt has the big brained move of uninstalling half your system if you try to reinstall a core dependency instead of just setting the dependant packages as disabled while it's missing or something, ffs.
- raverbashing 5y agoPoetry is almost that. It also takes 99% of the trouble of solving dependencies in pip files (though the usual way it breaks is your python interpreter gets updated and the venv becomes useless)
- moffkalast 5y agoThis sounds interesting. I'll check it out, thanks :)
- JettChenT 5y agoI don't think it's possible if you use a global environment for everything, as different packages might have conflicting dependencies. The best way to solve it is to separate environments. I personally prefer conda as it's fairly easy to create environments of any python version.