HiveBrain v1.2.0
Get Started
← Back to all entries
patternpythonCritical

Can I force pip to reinstall the current version?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
currentthepipcanforceversionreinstall

Problem

I've come across situations where a current version of a package seems not to be working and requires reinstallation. But pip install -U won't touch a package that is already up-to-date. I see how to force a reinstallation by first uninstalling (with pip uninstall) and then installing, but is there a way to simply force an "update" to a nominally current version in a single step?

Solution

pip install --upgrade --force-reinstall 


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

pip install -I 
pip install --ignore-installed 


Ignore the installed packages (reinstalling instead).

Code Snippets

pip install --upgrade --force-reinstall <package>
pip install -I <package>
pip install --ignore-installed <package>

Context

Stack Overflow Q#19548957, score: 1352

Revisions (0)

No revisions yet.