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?
To force re-download use the --no-cache-dir flag. Note that this command also reinstalls all dependencies.
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.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With