Look at these lines of the traceback:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/serialport.py", line 22, in <module>
import serial
File "/Users/me/Desktop/serial.py", line 1, in <module>
from twisted.internet.serialport import SerialPort
Here you see that .../twisted/internet/serialport.py
is doing this:
import serial
This is a line from Twisted. You can guess based on this fact that the serial
module the code wants to import is not something that you have written.
Then look at the next file in the traceback: /Users/me/Desktop/serial.py
. This tells you that Python found the serial
module in your personal desktop directory. import serial
is now running code you wrote. Based on the previous surmise, this is likely a bad thing.
Get rid of serial.py
(and serial.pyc
and serial.pyo
if they exist) and try again. It still may not work but the cause of the problem (and therefore the traceback) should at least be different.