Open RyanSinger opened 7 years ago
Did you install the other module (pip install ledgerblue) before ?
Did you install the other module (pip install ledgerblue) before ?
When trying to install this, I get this error in Ubuntu 16.04 64bits:
(snip)
Building wheels for collected packages: ledgerblue, hidapi, pycrypto, future, ecpy, olefile
Running setup.py bdist_wheel for ledgerblue ... done
Stored in directory: /home/andres/.cache/pip/wheels/8a/21/41/f4ecf6b8dfbee0620582d3f5698bcdf4f05b24defc364091d4
Running setup.py bdist_wheel for hidapi ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1bHpSF/hidapi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpCutWx9pip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_ext
cythoning hid.pyx to hid.c
building 'hid' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/hidapi
creating build/temp.linux-x86_64-2.7/hidapi/libusb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python2.7 -c hid.c -o build/temp.linux-x86_64-2.7/hid.o
hid.c: In function ‘__pyx_pf_3hid_6device_open’:
hid.c:1633:45: warning: passing argument 1 of ‘PyUnicodeUCS4_AsWideChar’ from incompatible pointer type [-Wincompatible-pointer-types]
__pyx_v_result = PyUnicode_AsWideChar(__pyx_v_serial_number, __pyx_v_cserial_number, __pyx_v_serial_len);
^
In file included from /usr/include/python2.7/Python.h:85:0,
from hid.c:4:
/usr/include/python2.7/unicodeobject.h:246:31: note: expected ‘PyUnicodeObject * {aka struct <anonymous> *}’ but argument is of type ‘PyObject * {aka struct _object *}’
# define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar
^
/usr/include/python2.7/unicodeobject.h:591:24: note: in expansion of macro ‘PyUnicode_AsWideChar’
PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python2.7 -c hidapi/libusb/hid.c -o build/temp.linux-x86_64-2.7/hidapi/libusb/hid.o
hidapi/libusb/hid.c:47:20: fatal error: libusb.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for hidapi
Running setup.py clean for hidapi
Running setup.py bdist_wheel for pycrypto ... done
Stored in directory: /home/andres/.cache/pip/wheels/80/1f/94/f76e9746864f198eb0e304aeec319159fa41b082f61281ffce
Running setup.py bdist_wheel for future ... done
Stored in directory: /home/andres/.cache/pip/wheels/c2/50/7c/0d83b4baac4f63ff7a765bd16390d2ab43c93587fac9d6017a
Running setup.py bdist_wheel for ecpy ... done
Stored in directory: /home/andres/.cache/pip/wheels/72/ba/cc/1a0b3a02e596452c2df1ef529264dfee1a7ad1dc5d59ab6182
Running setup.py bdist_wheel for olefile ... done
Stored in directory: /home/andres/.cache/pip/wheels/20/58/49/cc7bd00345397059149a10b0259ef38b867935ea2ecff99a9b
Successfully built ledgerblue pycrypto future ecpy olefile
Failed to build hidapi
Installing collected packages: appdirs, pyparsing, six, packaging, setuptools, hidapi, protobuf, pycrypto, future, ecpy, olefile, pillow, ledgerblue
Running setup.py install for hidapi ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1bHpSF/hidapi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4w02aq-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_ext
skipping 'hid.c' Cython extension (up-to-date)
building 'hid' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/hidapi
creating build/temp.linux-x86_64-2.7/hidapi/libusb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python2.7 -c hid.c -o build/temp.linux-x86_64-2.7/hid.o
hid.c: In function ‘__pyx_pf_3hid_6device_open’:
hid.c:1633:45: warning: passing argument 1 of ‘PyUnicodeUCS4_AsWideChar’ from incompatible pointer type [-Wincompatible-pointer-types]
__pyx_v_result = PyUnicode_AsWideChar(__pyx_v_serial_number, __pyx_v_cserial_number, __pyx_v_serial_len);
^
In file included from /usr/include/python2.7/Python.h:85:0,
from hid.c:4:
/usr/include/python2.7/unicodeobject.h:246:31: note: expected ‘PyUnicodeObject * {aka struct <anonymous> *}’ but argument is of type ‘PyObject * {aka struct _object *}’
# define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar
^
/usr/include/python2.7/unicodeobject.h:591:24: note: in expansion of macro ‘PyUnicode_AsWideChar’
PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python2.7 -c hidapi/libusb/hid.c -o build/temp.linux-x86_64-2.7/hidapi/libusb/hid.o
hidapi/libusb/hid.c:47:20: fatal error: libusb.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1bHpSF/hidapi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4w02aq-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-1bHpSF/hidapi/
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(And FYI the above was fixed by doing sudo apt install libudev-dev libusb-1.0-0-dev
in Ubuntu 16.04.)
I can confirm that @knocte suggestion to install libudev-dev libusb-1.0-0-dev
solves the problem.
i really suggest adding this to the general documentation for Nano setup
It worked for me at Ubuntu 17.04
Can confirm that installing the missing libusb-1.0-0-dev
worked for me on a live-boot Ubuntu 18.04
Thx! 👍