Last active
November 23, 2022 02:50
-
-
Save stucka/09cbd34c8bfec0c37dd8a122362ef9c1 to your computer and use it in GitHub Desktop.
Force pip to reinstall all Python packages (works great with https://gist.github.com/stucka/0ced1cc71e1a5c374a18874471636d69)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get install libxml2-dev libssl-dev libffi-dev libxslt1-dev python-dev libjpeg-dev | |
pip freeze --local >pipfreeze.txt | |
tr '\n' ' ' < pipfreeze.txt >pipfreeze2.txt | |
pip install --upgrade --force-reinstall `cat pipfreeze2.txt` |
I think you can just do this:
pip freeze --local >pipfreeze.txt
pip install --upgrade --force-reinstall -r pipfreeze.txt
Thank you, @landonepps's two-liner did the job when I was fighting ipython not launching on OSX High Sierra. There supposedly were dependency problems (despite module being installed) but I noticed that reinstalling troublesome module with pip was fixing the issue. As I had 108 python modules installed in total, these two lines spared me a lot of time. 👍
To avoid reinstalling from corrupted files, one may add the --no-cache-dir
option. (Will download all packages again.)
Thank you, @landonepps's two-liner did the job for the error : from robotide import main importerror cannot import name 'main'
Helped me fix a python dependency problem on Mac OS Big Sur after moving from brew's version to pyenv
. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI, the
tr
step isn't necessary.