I am doing a project where I want to pass information from an Arduino to a Raspberry Pi via USB. I've been looking at http://blog.makezine.com/2012/10/22/a-halloween-sound-trigger-with-raspberry-pi-and-arduino/ and Reading serial data from Arduino. I have downloaded python-serial and import serial works in python v2.7 but not v3.2
I've written a .py file but it seems it uses v3.2 Does anyone know how I can force it to run using v2.7?
Thanks
I have since tried what Goldilocks suggested.
- using #!/usr/bin/python2.7 at the start of the script
- running it as python2.7 firsttest.py
but to no avail. I can still use import serial in the Python shell with no error.
The error message in full:
Traceback (most recent call last):
File "firsttest.py", line 4, in < module >
import serial
ImportError: No module named serial
I should also point out that thanks to Goldilocks I have confirmed I am using python2.7 so there is a different problem. Could it be that the commandline looks for installed modules in a different location?
Thanks again.