Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cairocffi install failed on Ubuntu 18.04

I am running pip freeze on a python project, it shows string VERSION other than numberical version and it fails the package installation, the warning message is:

weasyprint 43 has requirement cairocffi>=0.9.0, but you'll have cairocffi file-.cairocffi-VERSION which is incompatible.

cairocffi===file-.cairocffi-VERSION

cairoccffi is a dependency of Weasyprint which i use in my project and weasypring version is correct:

WeasyPrint==43

I tried using pipreqs generates requirements.txt, it didn't show cairocffi package but the package installation fails with the same error.

I checked site-packages folder, it contains

cairocffi-file_.cairocffi_VERSION.dist-info/

which cause the issue.

Can someone help?

like image 471
Haifeng Zhang Avatar asked Mar 29 '19 05:03

Haifeng Zhang


1 Answers

This issue pops up if you have an older version of setuptools installed. You can upgrade to the latest version with pip install --upgrade setuptools.

Then, reinstall without using the cache: pip install --no-cache-dir cairocffi.

like image 115
USS1994 Avatar answered Oct 20 '22 03:10

USS1994