作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
python Python 3.9.13 (tags/v-6ren">
如何修复这个错误?
C:\Users\vanvl\OneDrive\Bureaublad\Progammeren\Project 1.02.2>python
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from Custom_Widgets import ProjectMaker
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\vanvl\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\Custom_Widgets\ProjectMaker.py", line 14, in <module>
import cairosvg
File "C:\Users\vanvl\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\cairosvg\__init__.py", line 26, in <module>
from . import surface # noqa isort:skip
File "C:\Users\vanvl\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\cairosvg\surface.py", line 9, in <module>
import cairocffi as cairo
File "C:\Users\vanvl\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\cairocffi\__init__.py", line 48, in <module>
cairo = dlopen(
File "C:\Users\vanvl\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\cairocffi\__init__.py", line 45, in dlopen
raise OSError(error_message) # pragma: no cover
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e
最佳答案
这是一个非常恼人的依赖性问题,因为 cairocffi 不是为 Windows 构建的,您需要额外的依赖性,如此处所述:https://cairocffi.readthedocs.io/en/stable/overview.html#installing-cairo-on-windows
更快的解决方案是执行以下操作:我使用了从非官方存储库安装的 pipwin https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycairo
pip install pipwin
pipwin install cairocffi
另请参阅此相关问题:get cairosvg working in windows
关于python - 操作系统错误 : no library called "cairo-2" was found (from Custom_Widgets import ProjectMaker),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73637315/
如何修复这个错误? C:\Users\vanvl\OneDrive\Bureaublad\Progammeren\Project 1.02.2>python Python 3.9.13 (tags/v
如何修复这个错误? C:\Users\vanvl\OneDrive\Bureaublad\Progammeren\Project 1.02.2>python Python 3.9.13 (tags/v
我是一名优秀的程序员,十分优秀!