[ms@who3young ~]$ pip install pynput Defaulting to user installation because normal site-packages is not writeable Collecting pynput Using cached pynput-1.7.6-py2.py3-none-any.whl (89 kB) Collecting evdev>=1.3 Using cached evdev-1.6.1.tar.gz (26 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting python-xlib>=0.17 Using cached python_xlib-0.33-py2.py3-none-any.whl (182 kB) Requirement already satisfied: six in /usr/lib/python3/site-packages (from pynput) (1.15.0) Building wheels for collected packages: evdev Building wheel for evdev (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for evdev (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [29 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-cpython-39 creating build/lib.linux-x86_64-cpython-39/evdev copying evdev/util.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/uinput.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/genecodes.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/ff.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/evtest.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/events.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/eventio_async.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/eventio.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/ecodes.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/device.py -> build/lib.linux-x86_64-cpython-39/evdev copying evdev/__init__.py -> build/lib.linux-x86_64-cpython-39/evdev running build_ext running build_ecodes writing /tmp/.private/ms/pip-install-nfdejtm4/evdev_8985cef16b164ad6bbd94477d6e54f59/evdev/ecodes.c (using /usr/include/linux/input.h /usr/include/linux/input-event-codes.h /usr/include/linux/uinput.h) building 'evdev._input' extension creating build/temp.linux-x86_64-cpython-39 creating build/temp.linux-x86_64-cpython-39/evdev x86_64-alt-linux-gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fwrapv -O2 -Wall -pipe -frecord-gcc-switches -Wall -pipe -frecord-gcc-switches -Wall -fPIC -I/usr/include/python3.9 -c evdev/input.c -o build/temp.linux-x86_64-cpython-39/evdev/input.o -std=c99 -Wno-error=declaration-after-statement evdev/input.c:10:10: fatal error: Python.h: Нет такого файла или каталога 10 | #include <Python.h> | ^~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-alt-linux-gcc' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for evdev Failed to build evdev ERROR: Could not build wheels for evdev, which is required to install pyproject.toml-based projects [ms@who3young ~]$
Уточните, пожалуйста, какая версия пакета у вас установлена и дистрибутив, на котором воспроизводится ошибка. Для этого пришлите вывод следующих команд: $ cat /etc/os-release $ apt-repo $ rpm -qi pip
Дистрибутив [ms@who3young ~]$ cat /etc/os-release NAME="Simply Linux" VERSION="10.1 (Captain Finn)" ID=altlinux VERSION_ID=10.1 PRETTY_NAME="Simply Linux 10.1 (Captain Finn)" ANSI_COLOR="1;36" CPE_NAME="cpe:/o:alt:slinux:10.1" BUILD_ID="Simply Linux 10.1" HOME_URL="https://www.basealt.ru/products/simplylinux/" BUG_REPORT_URL="https://bugs.altlinux.org/" Репозиторий [ms@who3young ~]$ sudo apt-repo rpm [p10] http://ftp.altlinux.org/pub/distributions/ALTLinux/ p10/branch/x86_64 classic rpm [p10] http://ftp.altlinux.org/pub/distributions/ALTLinux/ p10/branch/x86_64-i586 classic rpm [p10] http://ftp.altlinux.org/pub/distributions/ALTLinux/ p10/branch/noarch classic Версия pip [ms@who3young ~]$ sudo rpm -qi pip Name : pip Version : 22.2.2 Release : alt1 DistTag : p10+307737.1400.28.1 Architecture: noarch Install Date: Вт 27 дек 2022 16:48:19 Group : Development/Python3 Size : 122 License : MIT Signature : RSA/SHA512, Ср 26 окт 2022 11:51:48, Key ID 42f343a2c7eb80f9 Source RPM : python3-module-pip-22.2.2-alt1.src.rpm Build Date : Ср 26 окт 2022 11:51:43 Build Host : cas-p10.hasher.altlinux.org Relocations : (not relocatable) Packager : Stanislav Levin <slev@altlinux.org> Vendor : ALT Linux Team URL : https://pip.pypa.io Summary : Executable for PIP Description : Executable for PIP [ms@who3young ~]$
Попробуйте установить пакет python3-dev и после этого повторить установку модуля.
(Ответ для Alexander Makeenkov на комментарий #3) > Попробуйте установить пакет python3-dev и после этого повторить установку > модуля. Да. Всё установилось. Спасибо.