[英]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:我在 python 项目上运行
pip freeze
,它显示除数字版本之外的字符串 VERSION 并且包安装失败,警告消息是:
weasyprint 43 has requirement cairocffi>=0.9.0, but you'll have cairocffi file-.cairocffi-VERSION which is incompatible.
weasyprint 43 有要求 cairocffi>=0.9.0,但您将拥有不兼容的 cairocffi file-.cairocffi-VERSION。
cairocffi===file-.cairocffi-VERSION
cairoccffi is a dependency of Weasyprint which i use in my project and weasypring version is correct: cairoccffi 是我在项目中使用的 Weasyprint 的依赖项,并且 weasypring 版本是正确的:
WeasyPrint==43
I tried using pipreqs
generates requirements.txt, it didn't show cairocffi package but the package installation fails with the same error.我尝试使用
pipreqs
生成 requirements.txt,它没有显示 cairocffi 包,但包安装失败并出现相同的错误。
I checked site-packages folder, it contains我检查了 site-packages 文件夹,它包含
cairocffi-file_.cairocffi_VERSION.dist-info/
which cause the issue.导致问题的原因。
Can someone help?有人可以帮忙吗?
This issue pops up if you have an older version of setuptools installed.如果您安装了旧版本的setuptools ,则会弹出此问题。 You can upgrade to the latest version with
pip install --upgrade setuptools
.您可以使用
pip install --upgrade setuptools
升级到最新版本。
Then, reinstall without using the cache: pip install --no-cache-dir cairocffi
.然后,在不使用缓存的情况下重新安装:
pip install --no-cache-dir cairocffi
。
The latest version of cairocffi(1.0.2) seems to have a problem with versioning.最新版本的 cairocffi(1.0.2) 似乎存在版本控制问题。
>>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)卸载此版本并尝试安装版本(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
I found that following the Linux install instructions from this site is what finally cleared up the issue for me.我发现按照本网站的 Linux 安装说明最终为我解决了这个问题。 I am running Ubuntu on WSL (Windows Services for Linux).
我在 WSL(Linux 的 Windows 服务)上运行 Ubuntu。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.