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

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?