您正在导入模块,而不是类。所以,你必须写:
from serial import Serial
serial 模块正确: pip install pyserial .
serial
pip install pyserial