./bluez-5.47/sys/bluetooth/bluetooth.h:36:10: fatal error: 'endian.h' file not found
```
❯ pip install -r requirements.txt
Collecting bluepy (from -r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/27/91/6cfca10bee9862f93015413cf9e6a52c3081a71f1518963396a055128f8e/bluepy-1.3.0.tar.gz (217kB)
100% |████████████████████████████████| 225kB 1.3MB/s
Collecting pycrypto (from -r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz (446kB)
100% |████████████████████████████████| 450kB 1.3MB/s
Building wheels for collected packages: bluepy, pycrypto
Running setup.py bdist_wheel for bluepy ... error
Complete output from command /usr/local/opt/python@2/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-install-kJE_cE/bluepy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-wheel-f2_AkG --python-tag cp27:
running bdist_wheel
running build
running build_py
Working dir is /private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-install-kJE_cE/bluepy
execute make -C ./bluepy clean
execute make -C bluepy -j1
Failed to compile bluepy-helper. Exiting install.
Command was 'make -C bluepy -j1' in /private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-install-kJE_cE/bluepy
Return code was 2
Output was:
tar xzf bluez-src.tgz
touch ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c
cc -L. -g -Wall -Os -DHAVE_CONFIG_H -I./bluez-5.47/attrib -I./bluez-5.47 -I./bluez-5.47/lib -I./bluez-5.47/src -I./bluez-5.47/gdbus -I./bluez-5.47/btio -I./bluez-5.47/sys -I/usr/local/Cellar/glib/2.58.3/include/glib-2.0 -I/usr/local/Cellar/glib/2.58.3/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.42/include -o bluepy-helper bluepy-helper.c ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c -L/usr/local/Cellar/glib/2.58.3/lib -L/usr/local/opt/gettext/lib -lglib-2.0 -lintl -Wl,-framework -Wl,CoreFoundation
In file included from bluepy-helper.c:36:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/lib/bluetooth.c:38:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/lib/hci.c:44:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/lib/sdp.c:45:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/lib/uuid.c:33:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/attrib/att.c:35:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/attrib/gatt.c:34:
In file included from ./bluez-5.47/lib/sdp.h:35:
./bluez-5.47/sys/bluetooth/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/attrib/gattrib.c:36:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/attrib/utils.c:32:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/btio/btio.c:39:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/log.c:40:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/mgmt.c:33:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/crypto.c:33:
./bluez-5.47/src/shared/util.h:27:10: fatal error: 'byteswap.h' file not found
#include
^~~~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/att.c:34:
./bluez-5.47/src/shared/util.h:27:10: fatal error: 'byteswap.h' file not found
#include
^~~~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/queue.c:28:
./bluez-5.47/src/shared/util.h:27:10: fatal error: 'byteswap.h' file not found
#include
^~~~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/util.c:38:
./bluez-5.47/src/shared/util.h:27:10: fatal error: 'byteswap.h' file not found
#include
^~~~~~~~~~~~
1 error generated.
make: *** [bluepy-helper] Error 1
----------------------------------------
Failed building wheel for bluepy
Running setup.py clean for bluepy
Running setup.py bdist_wheel for pycrypto ... \python example.py --ma\done
Stored in directory: /Users/mxtnr/Library/Caches/pip/wheels/27/02/5e/77a69d0c16bb63c6ed32f5386f33a2809c94bd5414a2f6c196
Successfully built pycrypto
Failed to build bluepy
Installing collected packages: bluepy, pycrypto
Running setup.py install for bluepy ... error
Complete output from command /usr/local/opt/python@2/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-install-kJE_cE/bluepy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-record-6NqdRk/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
Working dir is /private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-install-kJE_cE/bluepy
execute make -C ./bluepy clean
execute make -C bluepy -j1
Failed to compile bluepy-helper. Exiting install.
Command was 'make -C bluepy -j1' in /private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-install-kJE_cE/bluepy
Return code was 2
Output was:
tar xzf bluez-src.tgz
touch ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c
cc -L. -g -Wall -Os -DHAVE_CONFIG_H -I./bluez-5.47/attrib -I./bluez-5.47 -I./bluez-5.47/lib -I./bluez-5.47/src -I./bluez-5.47/gdbus -I./bluez-5.47/btio -I./bluez-5.47/sys -I/usr/local/Cellar/glib/2.58.3/include/glib-2.0 -I/usr/local/Cellar/glib/2.58.3/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.42/include -o bluepy-helper bluepy-helper.c ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c -L/usr/local/Cellar/glib/2.58.3/lib -L/usr/local/opt/gettext/lib -lglib-2.0 -lintl -Wl,-framework -Wl,CoreFoundation
In file included from bluepy-helper.c:36:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/lib/bluetooth.c:38:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/lib/hci.c:44:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/lib/sdp.c:45:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/lib/uuid.c:33:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/attrib/att.c:35:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/attrib/gatt.c:34:
In file included from ./bluez-5.47/lib/sdp.h:35:
./bluez-5.47/sys/bluetooth/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/attrib/gattrib.c:36:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/attrib/utils.c:32:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/btio/btio.c:39:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/log.c:40:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/mgmt.c:33:
./bluez-5.47/lib/bluetooth.h:36:10: fatal error: 'endian.h' file not found
#include
^~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/crypto.c:33:
./bluez-5.47/src/shared/util.h:27:10: fatal error: 'byteswap.h' file not found
#include
^~~~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/att.c:34:
./bluez-5.47/src/shared/util.h:27:10: fatal error: 'byteswap.h' file not found
#include
^~~~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/queue.c:28:
./bluez-5.47/src/shared/util.h:27:10: fatal error: 'byteswap.h' file not found
#include
^~~~~~~~~~~~
1 error generated.
In file included from ./bluez-5.47/src/shared/util.c:38:
./bluez-5.47/src/shared/util.h:27:10: fatal error: 'byteswap.h' file not found
#include
^~~~~~~~~~~~
1 error generated.
make: *** [bluepy-helper] Error 1
----------------------------------------
Command "/usr/local/opt/python@2/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-install-kJE_cE/bluepy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-record-6NqdRk/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/fv/czs5vy5x6rx6zn__lg7ss5y80000gn/T/pip-install-kJE_cE/bluepy/
MiBand2 on master took 20s ❯ python example.py --mac F0:0F:F1:A5:64:A8 --init
Traceback (most recent call last):
File "example.py", line 5, in
from base import MiBand2
File "/Users/mxtnr/xp/xiaomi-mi-band-2-heart-rate/MiBand2/base.py", line 5, in
from Crypto.Cipher import AES
ImportError: No module named Crypto.Cipher
```
./bluez-5.47/sys/bluetooth/bluetooth.h:36:10: fatal error: 'endian.h' file not found
I looked into https://stackoverflow.com/questions/20813028/endian-h-not-found-on-mac-osx also. I haven't
/usr/include/machine/endian.h
too. I even haven't/usr/include
(it's macos, not a linux huh)I have x code entirely and I did the
xcode-select --install
earlier.