GithubHelp home page GithubHelp logo

import issue about cairosvg HOT 5 OPEN

McClowny avatar McClowny commented on June 2, 2024
import issue

from cairosvg.

Comments (5)

liZe avatar liZe commented on June 2, 2024

Please install the Cairo library using your Linux distribution’s package manager.

from cairosvg.

sildeag avatar sildeag commented on June 2, 2024

I get similar messages on Windows 11 with Python3.10 when I import cairosvg. Nothing I have tried has eliminated the messages.

from cairosvg.

liZe avatar liZe commented on June 2, 2024

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.

from cairosvg.

sildeag avatar sildeag commented on June 2, 2024

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
import 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_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 0x7e

from cairosvg.

liZe avatar liZe commented on June 2, 2024

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 :/.

from cairosvg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.