我正在使用pyserial,并使用pyserial模块。我最近从使用笔记本电脑转到了台式机。在桌面上,当在idle中使用测试脚本时,我已经成功地实现了以下内容:
ser = serial.Serial()
然而,当我使用精神病编码器运行一些代码时,我一直收到一个属性错误,说模块序列没有属性Serial。这段代码之前已经在我的笔记本电脑上成功运行过。
Hello from the pygame community. https://www.pygame.org/contribute.html
0.8191 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
Traceback (most recent call last):
File "C:\Users\uqakriti_local\Desktop\MSI Face Motor Project\MSI Face Motor Project\MSIthreadcodeinstructions.py", line 35, in <module>
ser = serial.Serial()
AttributeError: module 'serial' has no attribute 'Serial'我已尝试卸载并重新安装串行模块,但仍然看到相同的属性错误。有谁对此有任何可能的解决方案吗?
发布于 2021-05-18 14:14:06
https://stackoverflow.com/questions/67580386
复制相似问题