AttributeError: module 'serial' has no attribute 'EIGHTBITS'
时间: 2023-10-02 09:03:52 浏览: 97
这个错误通常出现在使用Python的serial库时。根据引用的内容,有时这个错误是因为文件名为"serial.py"的问题导致的,但你已经确认你的文件名不是这个。另外,你也没有遇到安装错误。
根据引用的建议,另一个可能的原因是你没有安装pyserial库。你可以通过运行以下命令来安装它:pip3 install pyserial。
此外,根据引用的提供的路径,你可以检查你的Python安装中是否存在名为"serial"的文件夹。这个文件夹中应该包含与你当前使用的版本相对应的serial库文件。
总结一下,解决"AttributeError: module 'serial' has no attribute 'EIGHTBITS'"的方法包括:
1. 确认你的Python文件名不是"serial.py"。
2. 确保你已经安装了pyserial库,可以使用命令pip3 install pyserial进行安装。
3. 检查你的Python安装中是否存在名为"serial"的文件夹,并确保其中包含正确版本的serial库文件。
希望这些方法能够帮助你解决这个问题!<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [AttributeError: module ‘serial‘ has no attribute ‘Serial‘解决办法](https://blog.csdn.net/ChenWenHaoHaoHao/article/details/130328922)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [AttributeError: module 'serial' has no attribute 'Serial'](https://blog.csdn.net/qq_41204464/article/details/89434643)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
相关推荐
![py](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)