AttributeError: module ‘serial‘ has no attribute ‘Serial‘

AttributeError: module ‘serial’ has no attribute ‘Serial’

AttributeError: module ‘serial’ has no attribute ‘Serial’

运行python的时候出现AttributeError: module ‘serial’ has no attribute ‘Serial’,我用的是pyCharm,原因可能是pyserial安装错误,找到python安装目录:
File --》Settings --》project:untitled --》
AttributeError: module ‘serial‘ has no attribute ‘Serial‘

点击show ALL
AttributeError: module ‘serial‘ has no attribute ‘Serial‘
找到你使用的python版本在后面的目录中找到pyvenv.cfg文件
AttributeError: module ‘serial‘ has no attribute ‘Serial‘
用记事本打开pyvenv.cfg文件,找到home目录,找到该目录
AttributeError: module ‘serial‘ has no attribute ‘Serial‘
再往里追两级,我的版本实例:C:\Users\win 10\AppData\Local\Programs\Python\Python37\Lib\site-packages
AttributeError: module ‘serial‘ has no attribute ‘Serial‘
在此文件夹中找到所有serial的文件删掉,然后再重装pyserial就可使用了!!!
AttributeError: module ‘serial‘ has no attribute ‘Serial‘