"libusb.h: нет такого файла или каталога" из модуля g cc compiling Python - PullRequest
0 голосов
/ 26 февраля 2020

Я получаю такую ​​ошибку, и мне не удалось найти правильный ответ по номеру rnet. Я попытался обновить программное обеспечение контроллера моего водяного насоса NZXT Kraken, и оно не запустится сейчас.

https://gitlab.com/leinardi/gkraken

Я был бы очень благодарен за некоторые рекомендации .

Вот моя полная ошибка:

  Running setup.py install for hidapi ... error
    ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-7z0im1kt/hidapi/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-ox5wudk7/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_ext
    cythoning hid.pyx to hid.c
    /usr/local/lib64/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-7z0im1kt/hidapi/hid.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    cythoning hidraw.pyx to hidraw.c
    /usr/local/lib64/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-7z0im1kt/hidapi/hidraw.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    building 'hid' extension
    creating build
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/hidapi
    creating build/temp.linux-x86_64-3.7/hidapi/libusb
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python3.7m -c hid.c -o build/temp.linux-x86_64-3.7/hid.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python3.7m -c hidapi/libusb/hid.c -o build/temp.linux-x86_64-3.7/hidapi/libusb/hid.o
    hidapi/libusb/hid.c:26: warning: "_GNU_SOURCE" redefined
       26 | #define _GNU_SOURCE /* needed for wcsdup() before glibc 2.10 */
          |
    <command-line>: note: this is the location of the previous definition
    hidapi/libusb/hid.c:47:10: fatal error: libusb.h: No such file or directory
       47 | #include <libusb.h>
          |          ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-7z0im1kt/hidapi/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-ox5wudk7/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-7z0im1kt/hidapi/ ```

1 Ответ

0 голосов
/ 26 февраля 2020

Это было решено с помощью:

sudo dnf install libusbx-devel libudev-devel
...