小编mie*_*har的帖子

Pyserial:“模块‘serial’没有‘tools’属性”

我有一些设备通过RS485 到 USB 转换器连接到我的笔记本电脑,并希望在 python 程序中检测它们。

我在Windows 7 Notebook 上使用PyCharm Community Edition运行此代码,我已经使用 pip 安装了 pyserial。

导入序列

x = list(serial.tools.list_ports.comports())
print(x)
Run Code Online (Sandbox Code Playgroud)

并得到这个错误:

回溯(最近一次调用):文件“C:/Users/rzzrgx/.PyCharmCE2018.3/config/scratches/scratch_1.py”,第 3 行,在 x = list(serial.tools.list_ports.comports()) AttributeError :模块“串行”没有属性“工具”

python pyserial python-3.x

4
推荐指数
1
解决办法
6233
查看次数

标签 统计

pyserial ×1

python ×1

python-3.x ×1