5

我正在尝试安装python蓝牙模块'lightblue'。我使用macports安装了它。当我导入模块时,它会导致一堆错误。

>> import lightblue
2012-12-21 07:04:13.874 Python[4062:f07] PyObjCPointer created: at 0x7fff788af900 of type {__CFBoolean=}
2012-12-21 07:04:13.875 Python[4062:f07] PyObjCPointer created: at 0x7fff788af8f0 of type {__CFBoolean=}
2012-12-21 07:04:13.876 Python[4062:f07] PyObjCPointer created: at 0x7fff788af910 of type {__CFNumber=}
2012-12-21 07:04:13.876 Python[4062:f07] PyObjCPointer created: at 0x7fff788af928 of type {__CFNumber=}
2012-12-21 07:04:13.876 Python[4062:f07] PyObjCPointer created: at 0x7fff788af940 of type {__CFNumber=}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/__init__.py", line 160, in <module>
    from _lightblue import *
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_lightblue.py", line 28, in <module>
    import _LightAquaBlue
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_LightAquaBlue.py", line 32, in <module>
    _FRAMEWORK_PATH)
ImportError: Cannot load LightAquaBlue framework, not found at/opt/local/Library/Frameworks/LightAquaBlue.framework

请帮我安装这个模块。我没有找到很多其他的蓝牙编程模块。pybluez没有mac版本

4

2 回答 2

3

这个版本在山狮上成功地为我工作。

于 2013-01-27T18:20:49.180 回答
2

我不确定这是否直接适用于原始问题......</p>

执行摘要:使用“sudo”并注意安装程序错误消息。

我尝试在运行 Xcode 5.0.2 的 Mac 上安装 lightblue-0.4

根据我在各个地方找到的建议,我将 setup.py 的最后一行更改为:

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

我将 setup.py 中的其他行更改为:

packages=["lightblue","LightAquaBlue"],
package_dir={"lightblue":getpackagedir(), "LightAquaBlue":"%s/LightAquaBlue" % getpackagedir()},
package_data={"lightblue":[ ], "LightAquaBlue":["LightAquaBlue.bridgesupport"]},

我不得不将 LightAquaBlue Base SDK 的 Xcode 中的构建设置更改为 OS X 10.9(它正在寻找 10.4u——“u”=“and up”吗?当我收到错误消息时,我没有使用 sudo Xcode)

在我使用“sudo python setup.py install”之前,我在运行安装时遇到了 chown 权限错误

最后(叹气),我不得不复制 Macintosh HD/Libraries/LightAquaBlue.framework 文件夹中的 LightAquaBlue 别名并将其粘贴到 Macintosh HD/Libraries/LightAquaBlue.framework/Versions/A 文件夹中

毕竟我得到了:

**安装成功**

这将在此文件夹中产生一堆目标文件:

lightblue-0.4/src/mac/LightAquaBlue/build/LightAquaBlue.build/Release/LightAquaBlue.build/Objects-normal/x86_64

于 2014-01-26T09:45:40.357 回答