我试图在OSX10.9上同时安装pybluez和LightBlue,但我得到了错误。 有人在小牛身上安装过这些软件吗?
我发现了浅蓝色的错误:
=== BUILD TARGET LightAquaBlue OF PROJECT LightAquaBlue WITH CONFIGURATION Release ===
Check dependencies
error: There is no SDK with the name or path '/Users/myname/Downloads/lightblue-0.4/src/mac/LightAquaBlue/macosx10.6'
** INSTALL FAILED **
The following build commands failed:
Check dependencies
(1 failure)
我发现了pyBluez的错误:
osx/_osxbt.c:676:5: error: unknown type name 'IOBluetoothDeviceInquiryRef'; did you mean 'IOBluetoothDeviceRef'?
IOBluetoothDeviceInquiryRef inquiry;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
IOBluetoothDeviceRef
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47: note: 'IOBluetoothDeviceRef' declared here
typedef struct OpaqueIOBluetoothObjectRef * IOBluetoothDeviceRef;
^
osx/_osxbt.c:688:17: error: unknown type name 'IOBluetoothDeviceInquiryRef'; did you mean 'IOBluetoothDeviceRef'?
IOBluetoothDeviceInquiryRef inquiryRef,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
IOBluetoothDeviceRef
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47: note: 'IOBluetoothDeviceRef' declared here
typedef struct OpaqueIOBluetoothObjectRef * IOBluetoothDeviceRef;
^
osx/_osxbt.c:703:19: warning: implicit declaration of function 'IOBluetoothDeviceInquiryCreateWithCallbackRefCon' is invalid in C99 [-Wimplicit-function-declaration]
dd->inquiry = IOBluetoothDeviceInquiryCreateWithCallbackRefCon (&dd);
^
osx/_osxbt.c:703:17: warning: incompatible integer to pointer conversion assigning to 'IOBluetoothDeviceRef' (aka 'struct OpaqueIOBluetoothObjectRef *') from 'int' [-Wint-conversion]
dd->inquiry = IOBluetoothDeviceInquiryCreateWithCallbackRefCon (&dd);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
osx/_osxbt.c:705:5: warning: implicit declaration of function 'IOBluetoothDeviceInquirySetCompleteCallback' is invalid in C99 [-Wimplicit-function-declaration]
IOBluetoothDeviceInquirySetCompleteCallback (dd->inquiry,
^
osx/_osxbt.c:717:5: warning: implicit declaration of function 'IOBluetoothDeviceInquiryStart' is invalid in C99 [-Wimplicit-function-declaration]
IOBluetoothDeviceInquiryStart (dd->inquiry);
^
osx/_osxbt.c:721:5: warning: implicit declaration of function 'IOBluetoothDeviceInquiryDelete' is invalid in C99 [-Wimplicit-function-declaration]
IOBluetoothDeviceInquiryDelete (dd->inquiry);
^
5 warnings and 2 errors generated.
error: command 'gcc' failed with exit status 1
PyBluez仅限于windows:
“PyBluez可以在GNU/Linux和Windows XP(Microsoft和Widcomm蓝牙堆栈)上工作。”—pybluez homepage
您似乎安装了错误版本的浅蓝色
它正在寻找OSX 10.6的文件。
下载并安装主发行版:https://github.com/postskolkovo/lightblue-0.4
如果您发现错误:
您必须打开setup.py并更改:
致:
通过this discussion
编辑
当我试图导入时,我实际上得到了一个关于Mavericks的
ImportError: Bundle could not be loaded
这似乎是64位计算机的修复方法:如果你遇到同样的事情可能是必要的。
还有另外一个版本,特别适用于mac osx 10.8https://github.com/0-1-0/lightblue-0.4。我也可以在OSX10.10Yosemite下运行这个版本。
我只需要按照setup.py文件中的以下行进行更改:
然后我在/Library/Python/2.7/site-packages/lightblue//u lightblue.py中插入了以下两个方法:
def deviceinquiredevicenameupdated_devices_devices remaining_u(自身、发送方、设备、设备remaining): 通过
def deviceInquiryUpdatingDeviceNamesStarted_devicesRemaining_u(self,sender,devicesRemaining):开始设备剩余: 通过
建造人之后:
完整的代码是:
最后一步是更改同一文件中的这一行:
到
对我来说那很好!
希望这是一个有用的帖子。
相关问题 更多 >
编程相关推荐