尝试在python2.7上导入蓝牙时出错

2024-09-29 23:20:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我在raspeberry pi 4上安装了python2.7,其中包含一个使用Bluethoth库(pybluez)的脚本,但是在导入库时脚本崩溃了。 Si我只是尝试在python2.7 shell上导入蓝牙库,我遇到了相同的错误“Attributeer:instancemethod对象的属性'doc”不可写

我无法切换到python3,我不明白为什么它不起作用,所以如果有人对此有疑问,我将不胜感激:)

代码:

Import bluetooth

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/bluetooth/__init__.py", line 282,
in <module>
"""
AtributeError: attribute '__doc__' of 'instancemethod' objects is not writable

谢谢


Tags: in脚本doclinepishellfilebluetooth

热门问题