萤石-module 'serial' has no attribute 'Serial'
module 'serial' has no attribute 'Serial'
问题代码:
1 import serial #导入pyserial 2 com = serial.Serial('com3' , 115200) #实例化串口,com3,波特率115200
报错:module 'serial' has no attribute 'Serial'
解决方法:1、卸载serial;2、卸载pyserial;3、重新打开编辑器。
1 pip uninstall serial 2 pip uninstall pyserial 3 pip install pyserial
转载请注明出处,欢迎讨论和交流!