8.14. Appendix 3: Drone plot#
Example of drone plot with the cairo library.
try:
import cairo
print("La librairie 'cairo' est déjà installée.")
except ImportError:
print("La librairie 'cairo' n'est pas trouvée. Installation en cours...")
%pip install pycairo
import cairo
print("La librairie 'cairo' a été installée et importée avec succès.")
La librairie 'cairo' n'est pas trouvée. Installation en cours...
Collecting pycairo
Downloading pycairo-1.28.0.tar.gz (662 kB)
?25l ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/662.5 kB ? eta -:--:--
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 662.5/662.5 kB 17.7 MB/s 0:00:00
?25h
Installing build dependencies ... ?25l-
\
|
/
done
?25h Getting requirements to build wheel ... ?25ldone
?25h Preparing metadata (pyproject.toml) ... ?25l-
\
error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [465 lines of output]
+ meson setup /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20 /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dwheel=true -Dtests=false --native-file=/tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-python-native-file.ini
The Meson build system
Version: 1.10.1
Source dir: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20
Build dir: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks
Build type: native build
Project name: pycairo
Project version: 1.28.0
C compiler for the host machine: cc (gcc 13.3.0 "cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0")
C linker for the host machine: cc ld.bfd 2.42
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/opt/hostedtoolcache/Python/3.9.25/x64/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) 1.8.1
Found CMake: /usr/local/bin/cmake (3.31.6)
Run-time dependency cairo found: NO (tried pkgconfig and cmake)
../cairo/meson.build:31:12: ERROR: Dependency "cairo" not found, tried pkgconfig and cmake
A full log can be found at /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-logs/meson-log.txt
::group::==== CI platform detected, click here for meson-log.txt contents. ====
Build started at 2026-02-17T21:06:11.695684
Main binary: /opt/hostedtoolcache/Python/3.9.25/x64/bin/python
Build Options: -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dwheel=true -Dtests=false --native-file=/tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-python-native-file.ini
Python system: Linux
The Meson build system
Version: 1.10.1
Source dir: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20
Build dir: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks
Build type: native build
Project name: pycairo
Project version: 1.28.0
-----------
Detecting compiler via: `cc --version` -> 0
stdout:
cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------
Running command: -cpp -x c -E -dM -
-----
-----------
Detecting linker via: `cc -Wl,--version` -> 0
stdout:
GNU ld (GNU Binutils for Ubuntu) 2.42
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
-----------
stderr:
collect2 version 13.3.0
/usr/bin/ld -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/cclp0M8C.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. --version -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o
-----------
Sanity testing C compiler: cc
Is cross compiler: False.
Sanity check compiler command line: cc sanitycheckc.c -o sanitycheckc.exe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:
-----
Sanity check compile stderr:
-----
Running test binary command: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/sanitycheckc.exe
-----------
Sanity check: `/tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/sanitycheckc.exe` -> 0
C compiler for the host machine: cc (gcc 13.3.0 "cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0")
C linker for the host machine: cc ld.bfd 2.42
-----------
Detecting archiver via: `gcc-ar --version` -> 0
stdout:
GNU ar (GNU Binutils for Ubuntu) 2.42
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
-----------
-----------
Detecting compiler via: `cc --version` -> 0
stdout:
cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------
Running command: -cpp -x c -E -dM -
-----
-----------
Detecting linker via: `cc -Wl,--version` -> 0
stdout:
GNU ld (GNU Binutils for Ubuntu) 2.42
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
-----------
stderr:
collect2 version 13.3.0
/usr/bin/ld -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/cc7ApkAw.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. --version -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o
-----------
Sanity testing C compiler: cc
Is cross compiler: False.
Sanity check compiler command line: cc sanitycheckc.c -o sanitycheckc.exe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:
-----
Sanity check compile stderr:
-----
Running test binary command: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/sanitycheckc.exe
-----------
Sanity check: `/tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/sanitycheckc.exe` -> 0
C compiler for the build machine: cc (gcc 13.3.0 "cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0")
C linker for the build machine: cc ld.bfd 2.42
-----------
Detecting archiver via: `gcc-ar --version` -> 0
stdout:
GNU ar (GNU Binutils for Ubuntu) 2.42
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
-----------
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Program python3 found: YES (/opt/hostedtoolcache/Python/3.9.25/x64/bin/python)
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpjohagxjq
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpjohagxjq/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpjohagxjq/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wall` -> 0
Compiler for C supports arguments -Wall: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp8jz4xpcu
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp8jz4xpcu/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp8jz4xpcu/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Warray-bounds` -> 0
Compiler for C supports arguments -Warray-bounds: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp750iqht2
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp750iqht2/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp750iqht2/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wcast-align` -> 0
Compiler for C supports arguments -Wcast-align: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpd838m59d
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpd838m59d/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpd838m59d/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wconversion` -> 0
Compiler for C supports arguments -Wconversion: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpzkicciux
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpzkicciux/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpzkicciux/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wextra` -> 0
Compiler for C supports arguments -Wextra: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpw4egxnfs
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpw4egxnfs/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpw4egxnfs/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wformat=2` -> 0
Compiler for C supports arguments -Wformat=2: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpaz7yzhu1
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpaz7yzhu1/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpaz7yzhu1/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wformat-nonliteral` -> 0
Compiler for C supports arguments -Wformat-nonliteral: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpbro5et4g
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpbro5et4g/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpbro5et4g/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wformat-security` -> 0
Compiler for C supports arguments -Wformat-security: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp755q0bbj
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp755q0bbj/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp755q0bbj/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wimplicit-function-declaration` -> 0
Compiler for C supports arguments -Wimplicit-function-declaration: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpsqyg0rfj
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpsqyg0rfj/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpsqyg0rfj/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Winit-self` -> 0
Compiler for C supports arguments -Winit-self: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpkdu9cpj0
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpkdu9cpj0/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpkdu9cpj0/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Winline` -> 0
Compiler for C supports arguments -Winline: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpchrtt4hz
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpchrtt4hz/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpchrtt4hz/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wmissing-format-attribute` -> 0
Compiler for C supports arguments -Wmissing-format-attribute: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp1ow9mum8
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp1ow9mum8/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp1ow9mum8/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wmissing-noreturn` -> 0
Compiler for C supports arguments -Wmissing-noreturn: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp_enww6v4
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp_enww6v4/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp_enww6v4/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wnested-externs` -> 0
Compiler for C supports arguments -Wnested-externs: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpro3z6e0b
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpro3z6e0b/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpro3z6e0b/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wold-style-definition` -> 0
Compiler for C supports arguments -Wold-style-definition: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpeuhpmt9d
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpeuhpmt9d/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpeuhpmt9d/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wpacked` -> 0
Compiler for C supports arguments -Wpacked: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpukk8b6p4
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpukk8b6p4/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpukk8b6p4/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wpointer-arith` -> 0
Compiler for C supports arguments -Wpointer-arith: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpk5rtqybq
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpk5rtqybq/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpk5rtqybq/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wreturn-type` -> 0
Compiler for C supports arguments -Wreturn-type: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpd1hngwib
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpd1hngwib/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpd1hngwib/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wshadow` -> 0
Compiler for C supports arguments -Wshadow: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpgc_10bw5
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpgc_10bw5/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpgc_10bw5/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wsign-compare` -> 0
Compiler for C supports arguments -Wsign-compare: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp0mjteuyk
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp0mjteuyk/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp0mjteuyk/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wstrict-aliasing` -> 0
Compiler for C supports arguments -Wstrict-aliasing: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmposx60msv
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmposx60msv/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmposx60msv/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wundef` -> 0
Compiler for C supports arguments -Wundef: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp5p_5rlrn
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp5p_5rlrn/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmp5p_5rlrn/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wunused-but-set-variable` -> 0
Compiler for C supports arguments -Wunused-but-set-variable: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpvvfj1y8i
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpvvfj1y8i/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpvvfj1y8i/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wswitch-default` -> 0
Compiler for C supports arguments -Wswitch-default: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpdu5wfu0m
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpdu5wfu0m/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpdu5wfu0m/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wmissing-field-initializers -Wno-missing-field-initializers` -> 0
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpnd5cw0cb
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpnd5cw0cb/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpnd5cw0cb/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wunused-parameter -Wno-unused-parameter` -> 0
Compiler for C supports arguments -Wno-unused-parameter: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpvl88vbkk
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpvl88vbkk/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpvl88vbkk/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -fno-strict-aliasing` -> 0
Compiler for C supports arguments -fno-strict-aliasing: YES
Running compile:
Working directory: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpllso7kxk
Code:
extern int i;
int i;
-----------
Command line: `cc /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpllso7kxk/testfile.c -o /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/tmpllso7kxk/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -fvisibility=hidden` -> 0
Compiler for C supports arguments -fvisibility=hidden: YES
Pkg-config binary missing from cross or native file, or env var undefined.
Trying a default Pkg-config fallback at pkg-config
Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
Determining dependency 'cairo' with pkg-config executable '/usr/bin/pkg-config'
env[PKG_CONFIG_PATH]:
env[PKG_CONFIG]: /usr/bin/pkg-config
-----------
Called: `/usr/bin/pkg-config --modversion cairo` -> 1
stderr:
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
Package 'cairo', required by 'virtual:world', not found
-----------
CMake binary for host machine is not cached
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Found CMake: /usr/local/bin/cmake (3.31.6)
Extracting basic cmake information
CMake Toolchain: Calling CMake once to generate the compiler state
Calling CMake (['/usr/local/bin/cmake']) in /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/__CMake_compiler_info__ with:
- "--trace-expand"
- "--trace-format=json-v1"
- "--no-warn-unused-cli"
- "--trace-redirect=cmake_trace.txt"
- "-G"
- "Ninja"
- "-DCMAKE_TOOLCHAIN_FILE=/tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/__CMake_compiler_info__/CMakeMesonTempToolchainFile.cmake"
- "."
CMake trace warning: add_executable() non imported executables are not supported
CMake TRACE: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/__CMake_compiler_info__/CMakeFiles/CMakeScratch/TryCompile-Dv7HEC/CMakeLists.txt:22 add_executable(['cmTC_d5546'])
CMake trace warning: target_link_libraries() TARGET cmTC_d5546 not found
CMake TRACE: /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/__CMake_compiler_info__/CMakeFiles/CMakeScratch/TryCompile-Dv7HEC/CMakeLists.txt:28 target_link_libraries(['cmTC_d5546', ''])
!meson_ci!/ci_include "/tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/cmake_cairo/CMakeMesonToolchainFile.cmake"
Try CMake generator: auto
!meson_ci!/ci_include "/tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/cmake_cairo/CMakeLists.txt"
Calling CMake (['/usr/local/bin/cmake']) in /tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/cmake_cairo with:
- "--trace-expand"
- "--trace-format=json-v1"
- "--no-warn-unused-cli"
- "--trace-redirect=cmake_trace.txt"
- "-DCMAKE_TOOLCHAIN_FILE=/tmp/pip-install-dc4bt873/pycairo_c160eecf39784ed8a8f06d3c7a10fb20/.mesonpy-0gmno3ks/meson-private/cmake_cairo/CMakeMesonToolchainFile.cmake"
- "."
-- Module search paths: ['/', '/opt', '/usr', '/usr/local']
-- CMake root: /usr/local/share/cmake-3.31
-- CMake architectures: ['x86_64-linux-gnu']
-- CMake lib search paths: ['lib', 'lib32', 'lib64', 'libx32', 'share', '', 'lib/x86_64-linux-gnu']
Preliminary CMake check failed. Aborting.
Run-time dependency cairo found: NO (tried pkgconfig and cmake)
../cairo/meson.build:31:12: ERROR: Dependency "cairo" not found, tried pkgconfig and cmake
::endgroup::
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> pycairo
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
?25h
Note: you may need to restart the kernel to use updated packages.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 2
1 try:
----> 2 import cairo
3 print("La librairie 'cairo' est déjà installée.")
ModuleNotFoundError: No module named 'cairo'
During handling of the above exception, another exception occurred:
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 7
5 print("La librairie 'cairo' n'est pas trouvée. Installation en cours...")
6 get_ipython().run_line_magic('pip', 'install pycairo')
----> 7 import cairo
8 print("La librairie 'cairo' a été installée et importée avec succès.")
ModuleNotFoundError: No module named 'cairo'
import cairo
import io
from IPython.display import Image, SVG, display
import math
# --- Paramètres du drone ---
arm_length = 150 # Longueur du bras du centre au centre du moteur/hélice
propeller_diameter = 100 # Diamètre de l'hélice
motor_radius = 20 # Rayon du disque du moteur
body_width = 80 # Largeur du support central rectangulaire
body_height = 120 # Hauteur du support central rectangulaire
# --- Paramètres du canevas ---
width, height = 600, 600 # Dimensions du canevas en pixels
# Créer une surface SVG en mémoire
# Nous dessinons sur un objet BytesIO pour capturer la sortie SVG
output_buffer = io.BytesIO()
surface = cairo.SVGSurface(output_buffer, width, height)
ctx = cairo.Context(surface)
# --- Configuration du contexte de dessin ---
# Déplacer l'origine au centre du canevas pour faciliter le dessin
ctx.translate(width / 2, height / 2)
# Définir la largeur des lignes par défaut
ctx.set_line_width(2)
# --- Dessin du support central rectangulaire ---
ctx.rectangle(-body_width / 2, -body_height / 2, body_width, body_height)
ctx.set_source_rgb(0.2, 0.2, 0.2) # Gris foncé pour le remplissage
ctx.fill_preserve()
ctx.set_source_rgb(0, 0, 0) # Noir pour le contour
ctx.stroke()
# --- Angles des bras (en radians) pour une configuration "X" ---
angles_deg = [45, 135, 225, 315]
angles_rad = [math.radians(a) for a in angles_deg]
# --- Dessin des bras, moteurs et hélices ---
for angle in angles_rad:
# Bras
ctx.move_to(0, 0) # Partir du centre
arm_x = arm_length * math.cos(angle)
arm_y = arm_length * math.sin(angle)
ctx.line_to(arm_x, arm_y)
ctx.set_source_rgb(0.5, 0.5, 0.5) # Gris pour le bras
ctx.stroke()
# Moteur (disque)
motor_center_x = arm_x
motor_center_y = arm_y
ctx.arc(motor_center_x, motor_center_y, motor_radius, 0, 2 * math.pi)
ctx.set_source_rgb(0.1, 0.1, 0.1) # Gris très foncé pour le moteur
ctx.fill_preserve()
ctx.set_source_rgb(0, 0, 0) # Noir pour le contour
ctx.stroke()
# Hélice (représentée par deux lignes se croisant)
propeller_half_length = propeller_diameter / 2
# Sauvegarder l'état actuel du contexte pour les transformations locales
ctx.save()
# Déplacer l'origine au centre du moteur pour dessiner l'hélice
ctx.translate(motor_center_x, motor_center_y)
# Première pale d'hélice (horizontale localement)
ctx.move_to(-propeller_half_length, 0)
ctx.line_to(propeller_half_length, 0)
ctx.set_source_rgb(0, 0, 0) # Noir pour l'hélice
ctx.set_line_width(3) # Ligne plus épaisse pour l'hélice
ctx.stroke()
# Deuxième pale d'hélice (verticale localement)
ctx.move_to(0, -propeller_half_length)
ctx.line_to(0, propeller_half_length)
ctx.stroke()
ctx.set_line_width(2) # Rétablir la largeur de ligne par défaut
# Restaurer l'état précédent du contexte (annuler les translations)
ctx.restore()
# Finaliser le dessin sur la surface
surface.finish()
# --- Afficher le dessin dans le notebook ---
# Rembobiner le buffer pour le lire
output_buffer.seek(0)
# Afficher l'image SVG générée
display(SVG(output_buffer.read()))
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[2], line 1
----> 1 import cairo
2 import io
3 from IPython.display import Image, SVG, display
ModuleNotFoundError: No module named 'cairo'