2016年3月6日 星期日

[RR Python] PyBluez Example, beacon_scan.py beacon.py executing problem

While running PyBluez examples, beacon_scan.py beacon.py, at the first time, there is error messages

    from gattlib import *ImportError: No module named gattlib

Apparently the module gattlib which is not installed causes this error.

However, as I tried to install gattlib by pip, another error raises

    Package glib-2.0 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `glib-2.0.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'glib-2.0' found
So I did 'apt-get install glib-2.0' and the error was removed. But...

    In file included from src/gattservices.cpp:12:0:
    src/gattlib.h:11:33: fatal error: boost/python/list.hpp: No such file or directory
     #include <boost/python/list.hpp>
                                     ^
    compilation terminated.

Yes, gattlib is still not installed because missing of boost. It's important to know that apt-get cannot find 'boost'. We have to install 'libboost-all-dev' instead.



After those above, 'beacon.py' and 'beacon_scan.py' are ready to go!






1 則留言:

  1. instead of apt-get install glib-2.0 , I had to run sudo apt-get install libglib2.0-dev to remove "glib-2.0 was not found error"

    回覆刪除