简体   繁体   English

Windows 10 上的 python 3.8 中的 PyCairo Pip 安装失败

[英]PyCairo Pip Install in python 3.8 on windows 10 is failing

I know a lot of threads have been made about this but none of them have solved my problem.我知道已经有很多线程与此相关,但没有一个解决了我的问题。 I'm trying to install Cairo through pip install.我正在尝试通过 pip install 安装开罗。 I am using the command prompt.我正在使用命令提示符。 Here's the error message:这是错误消息:

C:\python38\Scripts>pip install cairo
ERROR: Could not find a version that satisfies the requirement cairo (from versions: none)
ERROR: No matching distribution found for cairo

I was reading the dev log on github for pycairo and it looks like it says it should work for python 3.8 and windows 10, I'm not sure what to do here.我正在 github 上阅读 pycairo 的开发日志,看起来它说它应该适用于 python 3.8 和 windows 10,我不知道在这里做什么。 I saw one person solved this by running a VM of windows 7, I'm not sure how to do that or if it would work for my situation.我看到一个人通过运行 Windows 7 的 VM 解决了这个问题,我不确定该怎么做,或者它是否适合我的情况。

I really appreciate any help you can give me, thank you.我真的很感激你能给我的任何帮助,谢谢。

Try pycairo instead试试pycairo

pip install pycairo

Edit in response to comment:编辑以回应评论:

I found a similar question .我发现了一个类似的问题 Does this help?这有帮助吗?

pycairo is only available as a .tar.gz on pypi, so only source code. pycairo仅作为.tar.gz在 pypi 上可用,因此只有源代码。 Note that in order to compile it, you will need a C compiler and the cairo library pre installed in order to use请注意,为了编译它,您需要一个 C 编译器和预先安装的cairo库才能使用

pip install pycairo

Alternatively however, you can also just download the correct wheel file for python 3.8 from this website which will make the installation much simpler.或者,您也可以从该网站下载正确的 python 3.8 轮文件,这将使安装更简单。 You will not need to compile code this way, simply do您不需要以这种方式编译代码,只需执行

pip install <whl file>

after downloading the right one (most likely pycairo‑1.19.0‑cp38‑cp38‑win_amd64.whl )下载正确的后(最有可能是pycairo‑1.19.0‑cp38‑cp38‑win_amd64.whl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM