我一直在为python使用PySerial库,我似乎不明白为什么我必须专门导入模块的某个部分。这将给我一个错误:for item in serial.tools.list_ports.comports():上面的片段将返回"AttributeError: type object 'Serial‘没有属性'tools'“import serial.
我正在尝试使用运行Debian的Raspberry Pi上的Python2.6访问串口。我的脚本serial.py尝试导入pySerial:ser = serial.Serial('/dev/ttyAMA0', 9600)AttributeError: 'module' object has no attrib
应该安装pyserial和serial,但出现错误no module named serial jess@DESKTOP-4DGO4EU /cygdrive/c/fyptrial/fypcnnC:\Users\jess\AppData\Local\Programs\Python\Python36\python.exe: No module namedimp