python-evdev icon indicating copy to clipboard operation
python-evdev copied to clipboard

Unable to install on Fedora 34/Python3.9.6

Open RistrettoMike opened this issue 3 years ago • 9 comments

First time leaving a bug report, so apologies if I do this in the wrong way or place. I was trying to install Key Mapper on Fedora 34 this morning and it threw an error about evdev while attempting to install. Trying to install evdev manually with sudo pip3 install evdev returned this error:

Collecting evdev
  Using cached evdev-1.4.0.tar.gz (26 kB)
Using legacy 'setup.py install' for evdev, since package 'wheel' is not installed.
Installing collected packages: evdev
    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] = '"'"'/tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/setup.py'"'"'; __file__='"'"'/tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-d_vwjrlc/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/evdev
         cwd: /tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/
    Complete output (29 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.9
    creating build/lib.linux-x86_64-3.9/evdev
    copying evdev/util.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/uinput.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/genecodes.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/ff.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/evtest.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/events.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/eventio_async.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/eventio.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/ecodes.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/device.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/__init__.py -> build/lib.linux-x86_64-3.9/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.9
    creating build/temp.linux-x86_64-3.9/evdev
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.9 -c evdev/input.c -o build/temp.linux-x86_64-3.9/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 '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/setup.py'"'"'; __file__='"'"'/tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-d_vwjrlc/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/evdev Check the logs for full command output.

Feel free to let me know if I can help in any other way, but I may need some extra guidance dropping any other relevant logs/details. I'm new to Linux/GitHub.

Cheers,

~M

RistrettoMike avatar Sep 03 '21 12:09 RistrettoMike

Thanks for reporting @RistrettoMike . I'm experiencing the same problem. I keep following.

ghost avatar Sep 03 '21 15:09 ghost

i have this problem too

Proficus avatar Oct 01 '21 22:10 Proficus

Do you have python3-devel installed?

ssieb avatar Oct 02 '21 07:10 ssieb

Do you have python3-devel installed?

No

Proficus avatar Oct 02 '21 07:10 Proficus

Then that is why you're getting the fatal error: Python.h: No such file or directory error.

ssieb avatar Oct 02 '21 08:10 ssieb

Like Ssieb said, runningsudo dnf install python3-devel should fix your issue. It worked for me :)

RistrettoMike avatar Oct 02 '21 12:10 RistrettoMike

Like Ssieb said, runningsudo dnf install python3-devel should fix your issue. It worked for me :)

I will try , thanks

Proficus avatar Oct 02 '21 12:10 Proficus

You can easily solve the problem using the workaround in my pull-request. Just use dnf instead of pip.

sudo dnf install python-evdev

After that you can update to the latest version using:

sudo pip install evdev -U

pourmand1376 avatar Mar 22 '22 21:03 pourmand1376

still errors the same @pourmand1376

ipriyam26 avatar Apr 04 '23 07:04 ipriyam26