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?
-
1This question was closed for being a duplicate. I disagree that it is a duplicate, but the question does require more clarity. 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.– Tom ArandaAug 23, 2021 at 14:35
-
Does this answer your question? Pip "Ignoring invalid distribution" warning– TomerikooAug 23, 2021 at 16:20
-
@TomAranda First of all, this is a duplicate. And anyway, I don't see the benefit of opening it in its current state. As you said yourself, it lacks many details. It should have only been opened if and when the OP added the relevant details...– TomerikooAug 23, 2021 at 16:23
-
Does this answer your question? pip how to remove incorrectly installed package with a leading dash: "-pkgname"– miken32Aug 23, 2021 at 16:44
-
3I disagree with the "how do you dare to ask a question like that"-crows. I upvoted this question and the answer that helped me quickly solve my issue.– Q-lifeSep 22, 2021 at 10:46
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 '~'.
-
3Did you really mean to have "not" in "It will not solve your problem"? Sep 16, 2021 at 13:27
-
2I do not have any such file/folders starting with a tilde... yet i get this error.... Any other suggestions around? Feb 7, 2022 at 15:12
-
@DouglasJamesBock use the path from the warning message. the location is different if installed with
--user
Apr 16, 2022 at 1:37
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.
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
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)