In file included from bluez/btmodule.c:20:0:一開始以爲是權限問題(真是壞習慣,不仔細看錯誤訊息往往是欲速則不達),加了sudo後還是沒有用的。接著猜是virtualenv環境路徑没設好(這次錯怪它了)。查了Debian / Ubuntu: Fatal error: Python.h: No such file or Directory 才發現是不但没有python.h,整個python-dev都没裝啦啦啦。
bluez/btmodule.h:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pybluez
Failed to build pybluez
sudo apt-get install python-dev
簡單裝完後再pip pybluez,結果
#include <bluetooth/bluetooth.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
果然代誌不是像憨人想得那麽簡單呀- libbluetooth-dev没裝
總算
Successfully installed pybluez-0.22