gpt4 book ai didi

python - lightblue Python 模块不能在 mac 上工作

转载 作者:行者123 更新时间:2023-11-28 19:26:46 25 4
gpt4 key购买 nike

我正在尝试在 mac osx 10.7.2 上通过 Python 连接到 wiimote。

为此,我正在尝试使用 lightblue。运行时:import lightblue Python 给我这个错误。

   >>> import lightblue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/__init__.py", line 160, in <module>
from _lightblue import *
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_lightblue.py", line 27, in <module>
import _IOBluetooth
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_IOBluetooth.py", line 47, in <module>
globals=globals())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 142, in initFrameworkWrapper
_parseBridgeSupport(data, globals, frameworkName)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 42, in _parseBridgeSupport
objc.parseBridgeSupport(data, globals, frameworkName, *args, **kwds)
ValueError: cftype for 'IOBluetoothDeviceInquiryRef' must include gettypeid_func, tollfree or both

我在这里找到了一个有类似问题的:http://python.6.n6.nabble.com/Python-bridgesupport-issue-on-Lion-td2161049.html#a32196961但答案对我帮助不大,因为在我看来它已经在使用 lightblue 的文件了。有什么建议吗?

最佳答案

似乎是 Apple 的 gen_bridge_metadata 的错误脚本。您可以通过手动编辑生成的文件来消除错误。

打开/System/Library/Frameworks/IOBluetooth.framework/Versions/Current/Resources/BridgeSupport/IOBluetooth.bridgesupport并删除以 <cftype 开头的行.

关于python - lightblue Python 模块不能在 mac 上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8998426/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com