本文介绍了如何安装或者pybluez或LightBlue在OSX 10.9(小牛)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在OSX10.9同时安装pybluez和LightBlue,但我得到的错误。
有没有人已经成功地在小牛安装这些?

我收到此错误LightBlue:

  ===构建项目LightAquaBlue的目标LightAquaBlue使用配置发布===检查依赖性
错误:没有与名称或路径没有SDK/Users/myname/Downloads/lightblue-0.4/src/mac/LightAquaBlue/macosx10.6**安装失败**
下面的生​​成命令失败:
    检查依赖性
(1失败)


和我收到此错误pyBluez:

  OSX / _osxbt.c:676:5:错误:未知类型名称'IOBluetoothDeviceInquiryRef';你的意思是IOBluetoothDeviceRef?    IOBluetoothDeviceInquiryRef查询;    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~    IOBluetoothDeviceRef/Applications/X$c$c.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47:注意:IOBluetoothDeviceRef在这里声明typedef结构OpaqueIOBluetoothObjectRef * IOBluetoothDeviceRef;                                                                ^OSX / _osxbt.c:688:17:错误:未知类型名称'IOBluetoothDeviceInquiryRef';你的意思是IOBluetoothDeviceRef?                IOBluetoothDeviceInquiryRef inquiryRef,                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~                IOBluetoothDeviceRef/Applications/X$c$c.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47:注意:IOBluetoothDeviceRef在这里声明typedef结构OpaqueIOBluetoothObjectRef * IOBluetoothDeviceRef;                                                                ^OSX / _osxbt.c:703:19:警告:函数'IOBluetoothDeviceInquiryCreateWithCallbackRefCon'隐式声明的是C99 [-Wimplicit功能声明]无效    DD-GT&;查询= IOBluetoothDeviceInquiryCreateWithCallbackRefCon(安培; DD);                  ^OSX / _osxbt.c:703:17:警告:不兼容的整数指针转换分配给从'诠释'IOBluetoothDeviceRef(又名结构OpaqueIOBluetoothObjectRef *')[-Wint转换]    DD-GT&;查询= IOBluetoothDeviceInquiryCreateWithCallbackRefCon(安培; DD);                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~OSX / _osxbt.c:705:5:警告:函数'IOBluetoothDeviceInquirySetCompleteCallback'隐性声明是无效的C99 [-Wimplicit功能声明]    IOBluetoothDeviceInquirySetCompleteCallback(DD-GT&;查询,    ^OSX / _osxbt.c:717:5:警告:函数'IOBluetoothDeviceInquiryStart'隐性声明是无效的C99 [-Wimplicit功能声明]    IOBluetoothDeviceInquiryStart(DD-GT&;查询);    ^OSX / _osxbt.c:721:5:警告:函数'IOBluetoothDeviceInquiryDelete'隐性声明是无效的C99 [-Wimplicit功能声明]    IOBluetoothDeviceInquiryDelete(DD-GT&;查询);    ^5警告和产生2个错误。错误:命令'GCC'失败,退出状态1


解决方案

PyBluez是仅适用于Windows

PyBluez适用于GNU / Linux和Windows XP(微软的Widcomm蓝牙栈)。 -

它看起来像你安装LightBlue的错版

 检查依赖
错误:没有与名称或路径没有SDK/Users/myname/Downloads/lightblue-0.4/src/mac/LightAquaBlue/macosx10.6

它寻找一个OSX 10.6的文件。

下载并安装主分布:

修改结果
其实我有一个导入错误:包无法加载在小牛队时,我试图导入结果。
这似乎是对64位计算机的修补程序:

 使用os.system(X codebuild安装-arch'x86_64的-target LightAquaBlue -configuration发布DSTROOT = / = INSTALL_PATH /资源库/框架DEPLOYMENT_LOCATION = YES)

如果你遇到同样的事情可能是必要的。

I have tried to install both of pybluez and LightBlue on OSX10.9 but I am getting error. Does anyone has managed to install any of these on Mavericks?

I am getting this error for 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)


and I am getting this error for 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 is windows only:

"PyBluez works on GNU/Linux and Windows XP (Microsoft and Widcomm Bluetooth stacks)." - pybluez homepage

It looks like you're installing the wrong version of LightBlue

Check dependencies 
error: There is no SDK with the name or path '/Users/myname/Downloads/lightblue-0.4/src/mac/LightAquaBlue/macosx10.6'

it's looking for a file for OSX 10.6.

Download and install the master distribution: https://github.com/postskolkovo/lightblue-0.4

If you get the error:

Check dependencies
No architectures to compile for (ARCHS=$(NATIVE_ARCH_ACTUAL), VALID_ARCHS=i386 x86_64).

** INSTALL FAILED **

you'll have to open up setup.py and change:

os.system("xcodebuild install -arch '$(NATIVE_ARCH_ACTUAL)' -target LightAquaBlue -configuration Release DSTROOT=/ INSTALL_PATH=/Library/Frameworks DEPLOYMENT_LOCATION=YES")

to:

os.system("xcodebuild install -arch 'i386' -target LightAquaBlue -configuration Release DSTROOT=/ INSTALL_PATH=/Library/Frameworks DEPLOYMENT_LOCATION=YES")

via this discussion

Edit
I actually got a ImportError: Bundle could not be loaded on Mavericks when I tried to import.
This seems to be the fix for 64 bit computers:

os.system("xcodebuild install -arch 'x86_64' -target LightAquaBlue -configuration Release DSTROOT=/ INSTALL_PATH=/Library/Frameworks DEPLOYMENT_LOCATION=YES")

Might be necessary if you come across the same thing.

这篇关于如何安装或者pybluez或LightBlue在OSX 10.9(小牛)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 04:05