Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PIP3 | WARNING: Could not generate requirement for distribution -ertifi 2019.11.28

I recently uninstalled all pip3 the pip3 packages installed in my local system.

Now, whenever I type pip3 freeze, this warning pops up:

WARNING: Could not generate requirement for distribution -ertifi 2019.11.28 
(/usr/local/lib/python3.7/site-packages): Parse error at "'-ertifi='": Expected W:(abcd...)

How do I get rid of this warning.

I tried doing brew reinstall python3 as this would reinstall python3 along with pip3 but it doesn't seem to work.

Please help me figure this out.

like image 950
Ferran Avatar asked Jan 01 '20 12:01

Ferran


People also ask

Why does PIP3 install packages in a different path?

When pip3 is used in a virtual environment, it will generally install packages in a path similar to: Linux and MacOS have system Python, that you should leave alone if possible. System Python is configured to help the operating system work as intended.

How to fix errno 13 while updating pip/pip3 package installer?

While updating the pip/pip3 package installer, you may receive the above EnvironmentError with Errno 13, this will cause the update to fail. AS you can see in the console error logs, all you need to do is add --user at the end of the command that you are executing. This will fix the issue.

Why can't I run PIP3 on Windows?

A common problem with running Python tools such as pip3 in Windows, is not having it in the environment path so that you can access it from anywhere. In most cases, you can navigate to the default <python_dir>/scripts directory in which the tool is installed in order to run it.

Why is my Pip installation not recognized?

The main reasons for PIP not recognized are because PIP installation is not added to the system variable or the installation is incorrectly added in your PATH. To fix this issue, you can follow some methods below.


2 Answers

I got into similar problem after I have upgraded my pip under windows from version 20.1.1 to version 20.2.3

It turned out that old version of pip was renaming folders that it could not delete, replacing first letter with tilda ~

The new version of pip counts this tilda as hyphen - I don't know why

like image 123
Konstantin Popov Avatar answered Sep 18 '22 13:09

Konstantin Popov


So I was getting that same error but for a different package:

WARNING: Could not generate requirement for distribution -niso8601 8.0.0 (...) venv/lib/python3.6/site-packages): Parse error at "'-niso860'": Expected W:(abcd...)

It turned out to be a missing letter in my first package! I needed to have "aniso8601==7.0.0" I literally did a freeze from a different venv that had that same package I needed, copied and pasted into the requirements.txt in the new project's folder. The requirements.txt file in the new project then installed successfully.

TL;DR: My requirements.txt file had a typo.

like image 38
Eric Milliot-Martinez Avatar answered Sep 19 '22 13:09

Eric Milliot-Martinez