gpt4 book ai didi

python - OS X 10.8 上的浅蓝 : method signature mismatch

转载 作者:行者123 更新时间:2023-11-28 21:24:31 24 4
gpt4 key购买 nike

我正在使用 Nickolay Yegorov 的 port of LightBlue for OS X 10.8 .导入 lightblue 模块后,立即出现以下错误:

Traceback (most recent call last):
File "commander.py", line 3, in <module>
import lightblue
File "/usr/local/lib/python2.7/site-packages/lightblue/__init__.py", line 160, in <module>
from _lightblue import *
File "/usr/local/lib/python2.7/site-packages/lightblue/_lightblue.py", line 397, in <module>
class _AsyncDeviceInquiry(Foundation.NSObject):
TypeError: Error when calling the metaclass bases
class _AsyncDeviceInquiry does not correctly implement protocol IOBluetoothDeviceInquiryDelegate: the signature for method deviceInquiryComplete:error:aborted: is v@:@iB instead of v@:@iZ

似乎版本不匹配。是否有解决此问题的已知方法?

最佳答案

打开源文件src/mac/_lightblue.py Yegorov's repo .找到第 467 行(如下所示):

deviceInquiryComplete_error_aborted_ = objc.selector(
deviceInquiryComplete_error_aborted_, signature="v@:@iB")

将字符串 v@:@iB 更改为 v@:@iZ。从此来源重新安装 LightBlue:

cd <lightblue_root> && sudo python setup.py install

这应该可以解决签名错误。

二进制

dlamblin请求包含此修复程序的二进制文件。这是 my LightAquaBlue.framework ,为 OS X 10.8.2 和 Python 2.7.4 构建(放入 /Library/Frameworks)。

关于python - OS X 10.8 上的浅蓝 : method signature mismatch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15940541/

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