当我尝试安装cairosvg
时,表示要求已满足。
Requirement already satisfied: cairosvg in
c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages
Requirement already satisfied: cairocffi in
c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages
(from cairosvg)
Requirement already satisfied: lxml in
c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages
(from cairosvg)
Requirement already satisfied: cssselect in
c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages
(from cairosvg)
Requirement already satisfied: pillow in
c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages
(from cairosvg)
Requirement already satisfied: tinycss in
c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages
(from cairosvg)
Requirement already satisfied: cffi>=0.6 in
c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages
(from cairocffi->cairosvg)
Requirement already satisfied: olefile in
c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages
(from pillow->cairosvg)
Requirement already satisfied: pycparser in
c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages
(from cffi>=0.6->cairocffi->cairosvg)
但是当我尝试在IDLE中导入它时,它会出现以下错误:
import cairosvg
File "C:\Users\Kshitij\AppData\Local\Programs\Python\Python35\lib\site-
packages\cairosvg\__init__.py", line 29, in <module>
from . import surface
File "C:\Users\Kshitij\AppData\Local\Programs\Python\Python35\lib\site-
packages\cairosvg\surface.py", line 24, in <module>
import cairocffi as cairo
File "C:\Users\Kshitij\AppData\Local\Programs\Python\Python35\lib\site-
packages\cairocffi\__init__.py", line 41, in <module>
cairo = dlopen(ffi, *CAIRO_NAMES)
File "C:\Users\Kshitij\AppData\Local\Programs\Python\Python35\lib\site-
packages\cairocffi\__init__.py", line 34, in dlopen
return ffi.dlopen(names[0]) # pragma: no cover
File "C:\Users\Kshitij\AppData\Local\Programs\Python\Python35\lib\site-
packages\cffi\api.py", line 140, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "C:\Users\Kshitij\AppData\Local\Programs\Python\Python35\lib\site-
packages\cffi\api.py", line 786, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "C:\Users\Kshitij\AppData\Local\Programs\Python\Python35\lib\site-
packages\cffi\api.py", line 781, in _load_backend_lib
raise OSError(msg)
OSError: cannot load library libcairo.so.2: error 0x7e. Additionally,
ctypes.util.find_library() did not manage to locate a library called
'libcairo.so.2'
这可能是因为cairocffi
,因为它在导入时也会出现以下错误:
import cairocffi
File "C:\Users\Kshitij\AppData\Local\Programs\Python\Python35\lib\site-
packages\cairocffi\__init__.py", line 41, in <module>
cairo = dlopen(ffi, 'cairo', 'cairo-2')
File "C:\Users\Kshitij\AppData\Local\Programs\Python\Python35\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
我有一个64位基于Windows的架构与python 3.5并安装了cairocffi-0.8.0安装没有问题。
答案 0 :(得分:0)
我使用UniConverter2.0解决了这个问题。 我的环境是
C:\Program Files\UniConvertor-2.0rc4\dlls
)