pyserial的踩坑记录

20200603——在windows中出现module ‘serial’ has no attribute ‘Serial’
在windows操作系统命令行测试serial模块
import serial
ser = serial.Serial(‘COM15’)
出现异常module ‘serial’ has no attribute ‘Serial’
网上搜了一下,没找到具体的方案。后面尝试卸载serial模块
pip uninstall serial
最后出现Successfully uninstalled serial-0.0.97,感觉版本不对,再尝试卸载pyserial
pip uninstall pyserial
最后出现Successfully uninstalled pyserial-3.4
原来是同时安装serail和pyserial,导致serial冲突。先同时卸载两个模块,再单独安装pyserial。
C:\Users\Lingxc>pip install pyserial
Collecting pyserial
Using cached pyserial-3.4-py2.py3-none-any.whl (193 kB)
Installing collected packages: pyserial
Successfully installed pyserial-3.4

C:\Users\Lingxc>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值