8

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?

Haifeng Zhang
  • 30,077
  • 19
  • 81
  • 125

3 Answers3

11

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.

USS1994
  • 594
  • 1
  • 5
  • 16
0

The latest version of cairocffi(1.0.2) seems to have a problem with versioning.

>>pip3 show cairocffi
Name: cairocffi
**Version: file-.cairocffi-VERSION**
Summary: cffi-based cairo bindings for Python
Home-page: https://github.com/Kozea/cairocffi
Author: Simon Sapin
Author-email: community@kozea.fr
License: BSD
Location: /usr/local/lib/python3.5/dist-packages
Requires: cffi, setuptools

Uninstall this version and try to install version (1.0.1)

pip3 install cairocffi==1.0.1
>>pip3 show cairocffi
Name: cairocffi
Version: 1.0.1
Summary: cffi-based cairo bindings for Python
Home-page: https://github.com/Kozea/cairocffi
Author: Simon Sapin
Author-email: community@kozea.fr
License: BSD
Location: /home/one/.local/lib/python3.5/site-packages
Requires: cffi
0

I found that following the Linux install instructions from this site is what finally cleared up the issue for me. I am running Ubuntu on WSL (Windows Services for Linux).

weasyprint install doc

Chet
  • 11
  • 1