chrippa / ds4drv

A Sony DualShock 4 userspace driver for Linux
MIT License
1.05k stars 213 forks source link

fatal error - Python.h #209

Closed Jopp-gh closed 6 months ago

Jopp-gh commented 6 months ago

I did install ds4drv with sudo python3 setup.py install and it seemed to complete without issues, but then I got following error:

evdev/input.c:10:10: fatal error: Python.h: File or Folder not found
   10 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
error: Setup script exited with error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

checking, ds4drv --help I get:

$ ds4drv --help
Traceback (most recent call last):
  File "/usr/local/bin/ds4drv", line 33, in <module>
    sys.exit(load_entry_point('ds4drv==0.5.1', 'console_scripts', 'ds4drv')())
  File "/usr/local/bin/ds4drv", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.10/dist-packages/ds4drv-0.5.1-py3.10.egg/ds4drv/__main__.py", line 6, in <module>
  File "/usr/local/lib/python3.10/dist-packages/ds4drv-0.5.1-py3.10.egg/ds4drv/actions/__init__.py", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/ds4drv-0.5.1-py3.10.egg/ds4drv/action.py", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/ds4drv-0.5.1-py3.10.egg/ds4drv/config.py", line 15, in <module>
  File "/usr/local/lib/python3.10/dist-packages/ds4drv-0.5.1-py3.10.egg/ds4drv/uinput.py", line 6, in <module>
ModuleNotFoundError: No module named 'evdev'

Is somebody so nice to tell me how to complete this installation?

Jopp-gh commented 6 months ago

Solution I used pip to install, worked as expected.