2

I had a freash installation of pop os, installed pip and I updated everything usig the following command

sudo apt update
sudo apt upgrade

now I want to install the pynput module so I tried the following command

pip install pynput

But I got the following error

Collecting pynput
  Using cached pynput-1.7.3-py2.py3-none-any.whl (99 kB)
Collecting evdev>=1.3; "linux" in sys_platform
  Using cached evdev-1.4.0.tar.gz (26 kB)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from pynput) (1.15.0)
Requirement already satisfied: python-xlib>=0.17; "linux" in sys_platform in /usr/lib/python3/dist-packages (from pynput) (0.27)
Building wheels for collected packages: evdev
  Building wheel for evdev (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x6x_dhp2/evdev/setup.py'"'"'; __file__='"'"'/tmp/pip-install-x6x_dhp2/evdev/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-98m4gy5x
       cwd: /tmp/pip-install-x6x_dhp2/evdev/
  Complete output (29 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/evdev
  copying evdev/__init__.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/ecodes.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/events.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/ff.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/uinput.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/eventio_async.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/util.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/genecodes.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/evtest.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/eventio.py -> build/lib.linux-x86_64-3.8/evdev
  copying evdev/device.py -> build/lib.linux-x86_64-3.8/evdev
  running build_ext
  running build_ecodes
  writing 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-3.8
  creating build/temp.linux-x86_64-3.8/evdev
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c evdev/input.c -o build/temp.linux-x86_64-3.8/evdev/input.o -std=c99 -Wno-error=declaration-after-statement
  evdev/input.c:10:10: fatal error: Python.h: No such file or directory
     10 | #include <Python.h>
        |          ^~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for evdev
  Running setup.py clean for evdev
Failed to build evdev
Installing collected packages: evdev, pynput
    Running setup.py install for evdev ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = 

What to do now?

itsmmdoha
  • 21
  • 1

0 Answers0