Score:3

What is the package for pycairo in Ubuntu?

us flag

Plots, a plotting program, requires the dependency pycairo.

The Ubuntu repositories have two packages with the similar name, python3-gi-cairo and python3-cairo.

Which among these apt packages correspond to the PyPI package pycairo? I went through the package descriptions of python3-gi-cairo and python3-cairo, but am not sure which one is the one corresponding to pycairo, or if both are needed.

In general, how to find the relevant apt package in such cases, where two python packages have similar names?


Note: I am the maintainer of the PPA for Plots. I need to use the relevant apt package as a dependency in debian/control. Installing with pip is not an option.

Knud Larsen avatar
by flag
Hints : https://packages.ubuntu.com/focal/python3-gi-cairo → Python 3 Cairo bindings for the GObject library. .......... And `python3-cairo` https://packages.ubuntu.com/focal/python3-cairo
N0rbert avatar
zw flag
For building you probably need python3-cairo-dev . See https://packages.ubuntu.com/source/focal/pycairo .
Score:2
cn flag

According to the description for the python3-gi-cairo package (apt show python3-gi-cairo)...

GObject is an abstraction layer that allows programming with an object
 paradigm that is compatible with many languages. It is a part of Glib,
 the core library used to build GTK+ and GNOME.
 .
 This package contains the Python 3 Cairo bindings for GObject. It is mostly
 used by other bindings to map their GObjects to Python objects.

And here is the description for the python3-cairo package (apt show python3-cairo)...

This package contains modules that allow you to use the Cairo vector
 graphics library in Python3 programs.

So, the second one (python3-cairo) would be the package you want.

That said, the maintainers of the pycairo suggest that you install it via pip. For Ubuntu/Debian, they say to install the headers and pkg-config

$ sudo apt install libcairo2-dev pkg-config python3-dev

and then to install the pip3 package

$ pip3 install pycairo
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.