在新的TX2模组装完环境之后测试了一下之前用的程序,发现调用的串口部分有报错。
Python AttributeError: ‘module‘ object has no attribute ‘Serial‘
翻了一下参看之后看到Stackoverflow里面这一篇,看高赞回答发现自己就是单纯的装错库了。需要调用的库是PySerial,自己装的是Serial。卸掉换成对的就性了。
Python AttributeError: 'module' object has no attribute 'Serial' - Stack Overflowhttps://stackoverflow.com/questions/11403932/python-attributeerror-module-object-has-no-attribute-serial当然也有人是因为自己的程序名(XXX.py)与库名Serial.py冲突了,大家对号入座。
紧接着就是第二个问题,调用串口时被拒绝了。其实就是用户权限不够。