pip install pynput results in The 'linux/input.h' and 'linux/input-event-codes.h' include files are missing. on Termux #1

Open
opened 2024-03-31 15:59:48 +02:00 by Benjamin_Loison · 2 comments
pip install pynput
Collecting pynput
  Downloading pynput-1.7.6-py2.py3-none-any.whl.metadata (30 kB)
Requirement already satisfied: six in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from pynput) (1.16.0)
Collecting evdev>=1.3 (from pynput)
  Downloading evdev-1.7.0.tar.gz (30 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting python-xlib>=0.17 (from pynput)
  Downloading python_xlib-0.33-py2.py3-none-any.whl.metadata (6.2 kB)
Downloading pynput-1.7.6-py2.py3-none-any.whl (89 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.2/89.2 kB 4.8 MB/s eta 0:00:00
Downloading python_xlib-0.33-py2.py3-none-any.whl (182 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.2/182.2 kB 8.2 MB/s eta 0:00:00
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
  ╰─> [48 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-311
      creating build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/__init__.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/device.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/ecodes.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/eventio.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/eventio_async.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/events.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/evtest.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/ff.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/genecodes.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/uinput.py -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/util.py -> build/lib.linux-aarch64-cpython-311/evdev
      running egg_info
      writing evdev.egg-info/PKG-INFO
      writing dependency_links to evdev.egg-info/dependency_links.txt
      writing top-level names to evdev.egg-info/top_level.txt
      reading manifest file 'evdev.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files found matching 'evdev/ecodes.c'
      adding license file 'LICENSE'
      writing manifest file 'evdev.egg-info/SOURCES.txt'
      copying evdev/input.c -> build/lib.linux-aarch64-cpython-311/evdev
      copying evdev/uinput.c -> build/lib.linux-aarch64-cpython-311/evdev
      running build_ext
      running build_ecodes
      The 'linux/input.h' and 'linux/input-event-codes.h' include files
      are missing. You will have to install the kernel header files in
      order to continue:
      
          dnf install kernel-headers-$(uname -r)
          apt-get install linux-headers-$(uname -r)
          emerge sys-kernel/linux-headers
          pacman -S kernel-headers
      
      In case they are installed in a non-standard location, you may use
      the '--evdev-headers' option to specify one or more colon-separated
      paths. For example:
      
          python setup.py \
            build \
            build_ecodes --evdev-headers path/input.h:path/input-event-codes.h \
            build_ext --include-dirs path/ \
            install
      [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

DuckDuckGo and Google results seem to not precisely show how to solve this issue, if it is even possible.

```bash pip install pynput ``` ``` Collecting pynput Downloading pynput-1.7.6-py2.py3-none-any.whl.metadata (30 kB) Requirement already satisfied: six in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from pynput) (1.16.0) Collecting evdev>=1.3 (from pynput) Downloading evdev-1.7.0.tar.gz (30 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting python-xlib>=0.17 (from pynput) Downloading python_xlib-0.33-py2.py3-none-any.whl.metadata (6.2 kB) Downloading pynput-1.7.6-py2.py3-none-any.whl (89 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.2/89.2 kB 4.8 MB/s eta 0:00:00 Downloading python_xlib-0.33-py2.py3-none-any.whl (182 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.2/182.2 kB 8.2 MB/s eta 0:00:00 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 ╰─> [48 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-aarch64-cpython-311 creating build/lib.linux-aarch64-cpython-311/evdev copying evdev/__init__.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/device.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/ecodes.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/eventio.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/eventio_async.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/events.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/evtest.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/ff.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/genecodes.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/uinput.py -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/util.py -> build/lib.linux-aarch64-cpython-311/evdev running egg_info writing evdev.egg-info/PKG-INFO writing dependency_links to evdev.egg-info/dependency_links.txt writing top-level names to evdev.egg-info/top_level.txt reading manifest file 'evdev.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching 'evdev/ecodes.c' adding license file 'LICENSE' writing manifest file 'evdev.egg-info/SOURCES.txt' copying evdev/input.c -> build/lib.linux-aarch64-cpython-311/evdev copying evdev/uinput.c -> build/lib.linux-aarch64-cpython-311/evdev running build_ext running build_ecodes The 'linux/input.h' and 'linux/input-event-codes.h' include files are missing. You will have to install the kernel header files in order to continue: dnf install kernel-headers-$(uname -r) apt-get install linux-headers-$(uname -r) emerge sys-kernel/linux-headers pacman -S kernel-headers In case they are installed in a non-standard location, you may use the '--evdev-headers' option to specify one or more colon-separated paths. For example: python setup.py \ build \ build_ecodes --evdev-headers path/input.h:path/input-event-codes.h \ build_ext --include-dirs path/ \ install [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 ``` DuckDuckGo and Google results seem to not precisely show how to solve this issue, if it is even possible.
Author
Owner
pkg install libevdev
Checking availability of current mirror:
[*] https://is.mirror.flokinet.net/termux/termux-main: ok
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libevdev
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 43.5 kB of archives.
After this operation, 287 kB of additional disk space will be used.
Get:1 https://is.mirror.flokinet.net/termux/termux-x11 x11/main aarch64 libevdev aarch64 1.13.2 [43.5 kB]
Fetched 43.5 kB in 0s (89.8 kB/s)   
Selecting previously unselected package libevdev.
(Reading database ... 61168 files and directories currently installed.)
Preparing to unpack .../libevdev_1.13.2_aarch64.deb ...
Unpacking libevdev (1.13.2) ...
Setting up libevdev (1.13.2) ...
Processing triggers for man (1.14.6-1) ...

does not help.

```bash pkg install libevdev ``` ``` Checking availability of current mirror: [*] https://is.mirror.flokinet.net/termux/termux-main: ok Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: libevdev 0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded. Need to get 43.5 kB of archives. After this operation, 287 kB of additional disk space will be used. Get:1 https://is.mirror.flokinet.net/termux/termux-x11 x11/main aarch64 libevdev aarch64 1.13.2 [43.5 kB] Fetched 43.5 kB in 0s (89.8 kB/s) Selecting previously unselected package libevdev. (Reading database ... 61168 files and directories currently installed.) Preparing to unpack .../libevdev_1.13.2_aarch64.deb ... Unpacking libevdev (1.13.2) ... Setting up libevdev (1.13.2) ... Processing triggers for man (1.14.6-1) ... ``` does not help.
Author
Owner
https://www.reddit.com/r/termux/comments/w0zz2u/comment/ighmool/
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Benjamin_Loison/pynput#1
No description provided.