Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get this when using pip WARNING: Ignoring invalid distribution -ip?

Tags:

python

pip

For the past few weeks everytime I have downloaded a package using pip i get this: WARNING: Ignoring invalid distribution -ip (path to packages) . Any ideas why I get this?

like image 644
gasper101 Avatar asked Aug 22 '21 11:08

gasper101


People also ask

Why does-IP ignore invalid distribution-IP?

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

How to fix Python when you get warnings about invalid distribution?

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

Why do I get a -IP warning when upgrading Pip?

The point is that, you are getting this warning because pip notices that you have something installed on your machine with an invalid name, ‘-ip’. If I were to guess I would say that you attempted to upgrade pip itself at some point and misspellt ‘pip’. That’s probably the reason.

What should I include in my error messages in Pip?

Please include the version of Python and Pip you are using and list an example of the error, i.e. exactly what command you entered and the exact response. Gives an actual example of the error. Does this answer your question? Pip "Ignoring invalid distribution" warning


5 Answers

This occurs due to files names with the '~' prefix in site-packages. Please remove those files / folders. It will solve your problem.

You can list them with

ls -a /xx/xx/xx/lib/pythonx.x/site-packages | grep "^~"

Then remove files/folders prefixed by '~'.

like image 56
talha khalid Avatar answered Nov 14 '22 21:11

talha khalid


go to 'site-packages' directory, delete folders whose name start with ~ (tilde)

like image 45
Mustafa Kemal Avatar answered Nov 14 '22 21:11

Mustafa Kemal


This happens due to multiple versions installation of libraries, at times conda or pip failed to uninstall the versions instead rename it to "~ip" so, suggest we find site-packages in our python installation and search for "~ip" and delete such folders which begin with ~ip. Then the problem will get resolved and we will not get any such warnings. Otherwise, it is only a warning because of such folders existing in the installation that we can ignore.

like image 41
S Habeeb Ullah Avatar answered Nov 14 '22 22:11

S Habeeb Ullah


I faced the same issue. It got fixed by going to site-packages and deleting the folders starting with ~.

>pip install pyspark
WARNING: Ignoring invalid distribution -yspark (c:\users\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -yspark (c:\users\anaconda3\lib\site-packages)
Requirement already satisfied: pyspark in c:\users\appdata\roaming\python\python39\site-packages (3.2.1)
Requirement already satisfied: py4j==0.10.9.3 in c:\users\anaconda3\lib\site-packages (from pyspark) (0.10.9.3)
WARNING: Ignoring invalid distribution -yspark (c:\users\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -yspark (c:\users\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -yspark (c:\users\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -yspark (c:\users\anaconda3\lib\site-packages)

Deleted the duplicate folder ~spark 0.2.1.

>pip install pyspark
Requirement already satisfied: pyspark in c:\users\appdata\roaming\python\python39\site-packages (3.2.1)
Requirement already satisfied: py4j==0.10.9.3 in c:\users\anaconda3\lib\site-packages (from pyspark) (0.10.9.3)
like image 24
Amar_AI Avatar answered Nov 14 '22 20:11

Amar_AI


Go to site-packages folder and delete the folders with ~ symbol. I observed this happens when we install another version(upgrade/downgrade) using pip before uninstalling the previous version

Check below image

enter image description here

like image 42
Midhilesh Momidi Avatar answered Nov 14 '22 21:11

Midhilesh Momidi