How to fix Python when you get messages like:
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
Since Python is messy in the way it handles packages you sometimes need this fix.
This can happen when a package fails to install (reason may be permissions based).
- Backup Python root folder to an archive (RAR, ZIP or other)
- Navigate to the folder
..\Python39\Lib\site-packages
in File Explorer - Select and then delete all folders starting with
~
- If asked for Admin permissions grant it/all
The next time you upgrade Python packages you should not get those warnings.
I personally use this:
- Source - https://github.com/defjaf/pip_upgrade_outdated
- Package - https://pypi.org/project/pip-upgrade-outdated/
- How to run:
pip_upgrade_outdated.exe
Thank you for this solution. It works like magic. I pasted below the screenshot of my issue:

I followed all the steps you've provided and solved my problem.