使用pip安装cairosvg后,我试图使其正常工作,但似乎无法使其正常工作。我不想安装MSYS2和GTK +,所以我希望库足够(我有Graphviz)。但是,这就是我得到的:
>>> import ctypes.util
>>> path = ctypes.util.find_library('libcairo-2')
>>> print(path)
c:\MyPrograms\graphviz\bin\libcairo-2.dll
>>> import cairosvg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\U021586\AppData\Local\Programs\Python\Python36\lib\site-packages\cairosvg\__init__.py", line 41, in <module>
from . import surface # noqa
File "C:\Users\U021586\AppData\Local\Programs\Python\Python36\lib\site-packages\cairosvg\surface.py", line 24, in <module>
import cairocffi as cairo
File "C:\Users\U021586\AppData\Local\Programs\Python\Python36\lib\site-packages\cairocffi\__init__.py", line 41, in <module>
cairo = dlopen(ffi, 'cairo', 'cairo-2', 'cairo-gobject-2')
File "C:\Users\U021586\AppData\Local\Programs\Python\Python36\lib\site-packages\cairocffi\__init__.py", line 38, in dlopen
raise OSError("dlopen() failed to load a library: %s" % ' / '.join(names))
OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2
现在,此问题以前是here的问题,但从未得到正确回答。
有人可以帮忙吗?
谢谢!