Can I Force Pip To Reinstall The Current Version?


Answer :

pip install --upgrade --force-reinstall <package> 

When upgrading, reinstall all packages even if they are already up-to-date.

pip install -I <package> pip install --ignore-installed <package> 

Ignore the installed packages (reinstalling instead).


You might want to have all three options: --upgrade and --force-reinstall ensures reinstallation, while --no-deps avoids reinstalling dependencies.

$ sudo pip install --upgrade --no-deps --force-reinstall <packagename> 

Otherwise you might run into the problem that pip starts to recompile Numpy or other large packages.


If you want to reinstall packages specified in a requirements.txt file, without upgrading, so just reinstall the specific versions specified in the requirements.txt file:

pip install -r requirements.txt --ignore-installed 

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable