I'm attempting to install the PyGObject library in pycharm following this guide https://pygobject.gnome.org/getting_started.html attempting to do step 3 on the Ubuntu / Debian section:
pip3 install pycairo
and this is what is returned:
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [48 lines of output]
+ meson setup /tmp/pip-install-9mn9tc6a/pycairo_3bd8575d46fa4c3ba97005887d18ca79 /tmp/pip-install-9mn9tc6a/pycairo_3bd8575d46fa4c3ba97005887d18ca79/.mesonpy-n59ji4fk -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dwheel=true -Dtests=false --native-file=/tmp/pip-install-9mn9tc6a/pycairo_3bd8575d46fa4c3ba97005887d18ca79/.mesonpy-n59ji4fk/meson-python-native-file.ini
The Meson build system
Version: 1.5.2
Source dir: /tmp/pip-install-9mn9tc6a/pycairo_3bd8575d46fa4c3ba97005887d18ca79
Build dir: /tmp/pip-install-9mn9tc6a/pycairo_3bd8575d46fa4c3ba97005887d18ca79/.mesonpy-n59ji4fk
Build type: native build
Project name: pycairo
Project version: 1.27.0
C compiler for the host machine: cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C linker for the host machine: cc ld.bfd 2.38
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/home/demerf/PycharmProjects/gtkgtk/.venv/bin/python)
Compiler for C supports arguments -Wall: YES
Compiler for C supports arguments -Warray-bounds: YES
Compiler for C supports arguments -Wcast-align: YES
Compiler for C supports arguments -Wconversion: YES
Compiler for C supports arguments -Wextra: YES
Compiler for C supports arguments -Wformat=2: YES
Compiler for C supports arguments -Wformat-nonliteral: YES
Compiler for C supports arguments -Wformat-security: YES
Compiler for C supports arguments -Wimplicit-function-declaration: YES
Compiler for C supports arguments -Winit-self: YES
Compiler for C supports arguments -Winline: YES
Compiler for C supports arguments -Wmissing-format-attribute: YES
Compiler for C supports arguments -Wmissing-noreturn: YES
Compiler for C supports arguments -Wnested-externs: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Wpacked: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wreturn-type: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wsign-compare: YES
Compiler for C supports arguments -Wstrict-aliasing: YES
Compiler for C supports arguments -Wundef: YES
Compiler for C supports arguments -Wunused-but-set-variable: YES
Compiler for C supports arguments -Wswitch-default: YES
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-unused-parameter: YES
Compiler for C supports arguments -fno-strict-aliasing: YES
Compiler for C supports arguments -fvisibility=hidden: YES
Found pkg-config: YES (/usr/bin/pkg-config) 0.29.2
Run-time dependency cairo found: YES 1.16.0
Run-time dependency python found: NO (tried pkgconfig, pkgconfig and sysconfig)
../cairo/meson.build:51:15: ERROR: Python dependency not found
A full log can be found at /tmp/pip-install-9mn9tc6a/pycairo_3bd8575d46fa4c3ba97005887d18ca79/.mesonpy-n59ji4fk/meson-logs/meson-log.txt
[end of output]
I'm running Ubuntu 22.04.5 LTS and python 3.12 and very unfamiliar with linux systems, the log file at
/tmp/pip-install-9mn9tc6a/pycairo_3bd8575d46fa4c3ba97005887d18ca79/.mesonpy-n59ji4fk/meson-logs/meson-log.txt
cannot be found. attempting to do step 4 also returns a similar error.
Unless you need a new version Ubuntu packages it (as the docs say):
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-4.0
Otherwise don’t skip step 2:
sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0