Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Missing library called 'libcairo.so.2' #223

Open
CameronBrooks11 opened this issue Jul 24, 2022 · 0 comments
Open

Missing library called 'libcairo.so.2' #223

CameronBrooks11 opened this issue Jul 24, 2022 · 0 comments

Comments

@CameronBrooks11
Copy link

When I go to run any of the example .py files I get a module error: "ModuleNotFoundError: No module named 'gerber'". I was able to fix this by adding "sys.path.append(os.path.join(os.path.dirname(file), '..'))" at the beginning of the example file(s) but then I get the following error:

Traceback (most recent call last):
File "/home/ckb22/pcb-tools/examples/../gerber/render/cairo_backend.py", line 24, in
import cairo
ModuleNotFoundError: No module named 'cairo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "pcb_example.py", line 28, in
from gerber.render import theme
File "/home/ckb22/pcb-tools/examples/../gerber/render/init.py", line 27, in
from .cairo_backend import GerberCairoContext
File "/home/ckb22/pcb-tools/examples/../gerber/render/cairo_backend.py", line 26, in
import cairocffi as cairo
File "/home/ckb22/.local/lib/python3.8/site-packages/cairocffi/init.py", line 41, in
cairo = dlopen(ffi, *CAIRO_NAMES)
File "/home/ckb22/.local/lib/python3.8/site-packages/cairocffi/init.py", line 34, in dlopen
return ffi.dlopen(names[0]) # pragma: no cover
File "/home/ckb22/.local/lib/python3.8/site-packages/cffi/api.py", line 150, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "/home/ckb22/.local/lib/python3.8/site-packages/cffi/api.py", line 832, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "/home/ckb22/.local/lib/python3.8/site-packages/cffi/api.py", line 827, in _load_backend_lib
raise OSError(msg)
OSError: cannot load library 'libcairo.so.2': libcairo.so.2: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called 'libcairo.so.2'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant