python-evdev
python-evdev copied to clipboard
Unable to install on Fedora 34/Python3.9.6
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
Thanks for reporting @RistrettoMike . I'm experiencing the same problem. I keep following.
i have this problem too
Do you have python3-devel
installed?
Do you have
python3-devel
installed?
No
Then that is why you're getting the fatal error: Python.h: No such file or directory
error.
Like Ssieb said, runningsudo dnf install python3-devel
should fix your issue. It worked for me :)
Like Ssieb said, running
sudo dnf install python3-devel
should fix your issue. It worked for me :)
I will try , thanks
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
still errors the same @pourmand1376