(1)取下面网页上下载pyserial
https://pypi.python.org/pypi/pyserial
(2)将其拷贝到如下目录下
Python\Lib\site-packages\
(2)在对应的cmd下输入
pip install 路径名\pyserial-3.4-py2.py3-none-any.whl
(3)测试方法
import serial
ser = serial.Serial()
ser.baudrate = 19200
ser.port = 'COM2'
ser.open()
print(ser.isOpen())