Skip to content

Instantly share code, notes, and snippets.

@hl2guide
Last active May 16, 2022 11:01
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hl2guide/f8356cb686d2bf224464040d8f0b3a8f to your computer and use it in GitHub Desktop.
Save hl2guide/f8356cb686d2bf224464040d8f0b3a8f to your computer and use it in GitHub Desktop.
How to fix Python when you get messages like: WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)

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

Steps for Windows OS

  1. Backup Python root folder to an archive (RAR, ZIP or other)
  2. Navigate to the folder ..\Python39\Lib\site-packages in File Explorer
  3. Select and then delete all folders starting with ~
  4. 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:

@rmenese
Copy link

rmenese commented Feb 8, 2022

Thank you for this solution. It works like magic. I pasted below the screenshot of my issue:
cmdPython-Warning!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment