#Python AttributeError: module object has no attribute Serial
Explore tagged Tumblr posts
Text
Python AttributeError: module object has no attribute Serial
Im adding this solution for people who make the same mistake as I did.
In most cases: rename your project file serial.py and delete serial.pyc if exists, then you can do simple import serial without attribute error.
Problem occurs when you import something when your python file name is something.py.
I accidentally installed serial (sudo python -m pip install serial) instead of pySerial (sudo python -m pip install pyserial), which lead to the same error.
If the previously mentioned solutions did not work for you, double check if you installed the correct library
0 notes