Python中文
首页
教程
问答
标签
搜索
登录
注册
Linux Min上的Python3错误“没有命名为bluetooth的模块”
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正在尝试通过蓝牙将我的联想S10E连接到任天堂Wiimote。我使用的是一个简单的Python脚本,如下所示。我在Linux Mint(版本16,“Petra”)命令行中使用<code>python3 find_wii.py</code>调用它</p> <p>脚本:</p> <pre><code>import bluetooth target_name = "Nintendo RVL-CNT-01" target_address = "00:1C:BE:29:75:7F" nearby_devices = bluetooth.discover_devices() for bdaddr in nearby_devices: if target_name == bluetooth.lookup_name( bdaddr ): target_address = bdaddr break if target_address is not None: print("found target bluetooth device with address "), target_address else: print("could not find target bluetooth device nearby") </code></pre> <p>我收到错误信息</p> <pre><code>Traceback (most recent call last): File "find_wii.py", line 1, in <module> import bluetooth ImportError: No module named 'bluetooth' </code></pre> <p>我已经为它安装了bluez和python包装(<code>sudo aptitude install python-bluez</code>)。我已经升级了我的系统(<code>sudo apt-get update</code>,<code>sudo apt-get upgrade</code>)。我确实咨询过谷歌,我唯一能找到的官方错误是<a href="https://code.google.com/p/remuco/issues/detail?id=137" rel="noreferrer">here</a>和<a href="https://code.google.com/p/pybluez/issues/detail?id=36" rel="noreferrer">here</a>,而且这两个答案都不适合我。</p> <p>如何使蓝牙模块正常工作?</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>您已经安装了Python 2版本的bluez绑定。使用<code>python2</code>运行脚本或安装Python 3绑定。由于它们没有打包,您需要使用pip安装它们:</p> <pre><code>python3 -m pip install pybluez </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何在python中从数据帧列中删除分类值?
4 回答
如何在python中从数据帧列表中删除引号
4 回答
如何在python中从数据帧创建列表
3 回答
如何在Python中从数据帧创建嵌套的JSON
3 回答
如何在Python中从数据帧显示wordcloud
3 回答
如何在Python中从数据帧的时间戳中删除字符
1 回答
如何在Python中从数据帧绘制简单绘图?
2 回答
如何在python中从数据帧行提取具有特定长度的范围?
1 回答
如何在python中从数据帧设置dict中的值
2 回答
如何在Python中从数据库中获得一个结果
8 回答
如何在python中从数据框中绘制分类条形图
3 回答
如何在Python中从数据框中选择特定细节?
3 回答
如何在python中从数据集中删除unicode
1 回答
如何在python中从数据集中删除某些数值?
4 回答
如何在python中从数据集中选择行
6 回答
如何在Python中从数组中删除元素
6 回答
如何在python中从数组中删除单个倒逗号?
9 回答
如何在python中从数组中删除对象?
9 回答
如何在python中从数组中删除引号
10 回答
如何在python中从数组中删除所有最小值
9 回答