Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I force pip to reinstall the current version?

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?

like image 745
orome Avatar asked Oct 23 '13 17:10

orome


People also ask

How do I force reinstall pip package?

To force re-download use the --no-cache-dir flag. Note that this command also reinstalls all dependencies.

Is there a pip reinstall?

5 Answers. When you are upgrading the pip, you should reinstall all packages even if they are already up-to-date, In that case, you should ignore the installed packages (reinstalling instead). You can use the following command to ignore the installed packages.

What is force reinstall?

Once in a while, a Python package gets corrupted on your machine and you need to force pip to reinstall it. As of pip 10.0, you can run the following: pip install --force-reinstall <corrupted package> This will force pip to re-install <corrupted package> and all its dependencies.


Video Answer


1 Answers

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).

like image 75
KGo Avatar answered Oct 14 '22 16:10

KGo