Open McClowny opened 1 year ago
Please install the Cairo library using your Linux distribution’s package manager.
I get similar messages on Windows 11 with Python3.10 when I import cairosvg
. Nothing I have tried has eliminated the messages.
Nothing I have tried has eliminated the messages.
On Windows, you can install GTK3 (keeping the default options) and then reboot your computer, it will work.
Thank you for the tips. I have installed GTK3 and rebooted, these are the messages: Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\me> python3.10 Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
import cairosvg; Traceback (most recent call last): File "
", line 1, in File "C:\Users\me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\cairosvg__init.py", line 26, in from . import surface # noqa isort:skip File "C:\Users\me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\cairosvg\surface.py", line 9, in 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 cannot load library 'C:\Program Files\GTK3-Runtime Win64\bin\libcairo-2.dll': error 0x7e cannot load library 'libcairo.so.2': error 0x7e cannot load library 'libcairo.2.dylib': error 0x7e cannot load library 'libcairo-2.dll': error 0x7eimport cairocffi as cairo File "C:\Users\me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\cairocffi__init__.py", line 48, in cairo = dlopen( File "C:\Users\me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\cairocffi\
Python found the library in 'C:\Program Files\GTK3-Runtime Win64\bin\libcairo-2.dll'
, but couldn’t use it for some reason. And to be honest, I have no idea why :/.
when i import cariosvg in my code i get this error