(Apr-12-2017, 05:56 AM)oz1sej Wrote: "import serial" at the start of the program triggers no errors despite the fact that the file serial.py is not in the directory. Shouldn't it?
That is ok, the location where module got installed is (considering your observation) in Python's search path, and that's all that is needed.
'/dev/ttyUSB0': FileNotFoundError
suggests there is no 'ttyUSB0' device in the /dev/ directory, can you verify that?I assume you are using this resource. It is generic, so you may need to modify things here and there (e.g. change port/device names, to avoid issues like you've encountered).
Also, to avoid unpleasant surprises in future... when you run code that opens serial port, make sure to close it afterwards with ser.close() or you will get errors due to port already open next time try to open it.
Or you can use with serial.Serial... which will close it for you after its work is done.