AshhadDevLab
AshhadDevLab

Reputation: 536

libcairo-2.dll or libcairo library not found

I created a tkinter project which shows user-data analysis using pygal graph plotter. The graph is using a library to render the png file called cairosvg. I am facing the following issue when running the code:

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
Exception in Tkinter callback

Also I have the same project in another folder in that folder I got cairocffi version=1.3.0 installed the same project is showing the graph but when I copy the project into another environment and download the same version it doesnt work. The solutin I found was, if I copy the cairocffi folder from the environment in which the project is working the other project works fine as well.

This is the file tree in my current project of cairocffi:

D:.
│   constants.py
│   context.py
│   ffi_build.py
│   fonts.py
│   matrix.py
│   patterns.py
│   pixbuf.py
│   surfaces.py
│   test_cairo.py
│   test_numpy.py
│   test_pixbuf.py
│   test_xcb.py
│   VERSION
│   xcb.py
│   __init__.py
│
├───_generated
│   │   ffi.py
│   │   ffi_pixbuf.py
│   │
│   └───__pycache__
│           ffi.cpython-311.pyc
│           ffi_pixbuf.cpython-311.pyc
│
└───__pycache__
        constants.cpython-311.pyc
        context.cpython-311.pyc
        ffi_build.cpython-311.pyc
        fonts.cpython-311.pyc
        matrix.cpython-311.pyc
        patterns.cpython-311.pyc
        pixbuf.cpython-311.pyc
        surfaces.cpython-311.pyc
        test_cairo.cpython-311.pyc
        test_numpy.cpython-311.pyc
        test_pixbuf.cpython-311.pyc
        test_xcb.cpython-311.pyc
        xcb.cpython-311.pyc
        __init__.cpython-311.pyc

This is the file tree in my working project of cairocffi:

D:.
│   cairo.dll
│   constants.py
│   context.py
│   ffi_build.py
│   fonts.py
│   matrix.py
│   patterns.py
│   pixbuf.py
│   surfaces.py
│   test_cairo.py
│   test_numpy.py
│   test_pixbuf.py
│   test_xcb.py
│   VERSION
│   xcb.py
│   __init__.py
│
├───_generated
│   │   ffi.py
│   │   ffi_pixbuf.py
│   │
│   └───__pycache__
│           ffi.cpython-311.pyc
│           ffi_pixbuf.cpython-311.pyc
│
└───__pycache__
        constants.cpython-311.pyc
        context.cpython-311.pyc
        ffi_build.cpython-311.pyc
        fonts.cpython-311.pyc
        matrix.cpython-311.pyc
        patterns.cpython-311.pyc
        pixbuf.cpython-311.pyc
        surfaces.cpython-311.pyc
        test_cairo.cpython-311.pyc
        test_numpy.cpython-311.pyc
        test_pixbuf.cpython-311.pyc
        test_xcb.cpython-311.pyc
        xcb.cpython-311.pyc
        __init__.cpython-311.pyc

Upvotes: 0

Views: 259

Answers (0)

Related Questions