module ‘serial’ has no attribute ‘Serial’

    技术2022-07-29  72

    module ‘serial’ has no attribute ‘Serial’

    问题代码:

    import serial # 导入pyserial com = serial.Serial('com3', 115200) # 实例化串口,com3,波特率115200

    报错:module ‘serial’ has no attribute ‘Serial’ 解决办法:1、卸载serial;2、卸载pyserial;3、重新打开你的编辑器。

    pip uninstall serial pip uninstall pyserial pip install pyserial
    Processed: 0.009, SQL: 9