Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install on Fedora 34/Python3.9.6 #164

Open
RistrettoMike opened this issue Sep 3, 2021 · 9 comments
Open

Unable to install on Fedora 34/Python3.9.6 #164

RistrettoMike opened this issue Sep 3, 2021 · 9 comments

Comments

@RistrettoMike
Copy link

RistrettoMike commented Sep 3, 2021

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

@ghost
Copy link

ghost commented Sep 3, 2021

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

@Proficus
Copy link

Proficus commented Oct 1, 2021

i have this problem too

@ssieb
Copy link

ssieb commented Oct 2, 2021

Do you have python3-devel installed?

@Proficus
Copy link

Proficus commented Oct 2, 2021

Do you have python3-devel installed?

No

@ssieb
Copy link

ssieb commented Oct 2, 2021

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

@RistrettoMike
Copy link
Author

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

@Proficus
Copy link

Proficus commented Oct 2, 2021

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

I will try , thanks

@pourmand1376
Copy link

pourmand1376 commented Mar 22, 2022

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

@ipriyam26
Copy link

still errors the same
@pourmand1376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants