No module named grovepi [solved]

I’m using the sample code from:
http://www.dexterindustries.com/GrovePi/projects-for-the-raspberry-pi/raspberry-pi-twitter-sensor-feed/
and
http://www.dexterindustries.com/GrovePi/projects-for-the-raspberry-pi/raspberry-pi-motion-sensing/

Using python 2 on the raspberry pi, each time I try to run these programs I get the error:
“import grovepi ImportError: No module named grovepi”

I have run the setup, and tested the grove_led_blink.py program successfully, so I know the grovepi is working.

HELP!! Any help would be greatly appreciated.

Thanks - Mark

Hi Mark,
Can you try running setup.py in the Python folder ( https://github.com/DexterInd/GrovePi/blob/master/Software/Python/setup.py) :
sudo python setup.py install.
That should install the solve the problem.

Please let me know if you still face any problems.
-Karan

Hi Karan,

Can you please explain what the setup.py script does?

My understanding is that it copies the grovepi.py script into a library that is accessible to all python scripts using an import grovepi. Does that sound right?

Does that mean we need to run the setup.py script again each time we get the latest changes from your git repo, where the grovepi.py file has changed?

Hi mcauser,
You are completely right, the script creates and installs the GrovePi library so that it’s accessible from the Python interpreter and you would have to run it again if you have made any changes to the library and want that to be accessible from Python too.

-Karan

Hello, i’ve got the same problem but i don’t know what to do. I wrote the setup.py fiel in /usr/lib/python2.7 and run “sudo python setup.py install” All seems fine but when i run the command “import grovepi” i got the error message “ImportError : No modle named grovepi”

can you help me ?
thanks

Hello,
i did the procedure again and then go to /home/pi/Desktop/Grovepi/Software/python/ and run sudo python setup.py install

Now it’s ok

have a good day

Hi I have a similar problem but mine is more of the issue no module named: Twitter. I have tried the python setup.py install but the issue still exist.

I hope you can assist me in solving this issue.

Thank You

Hey,
You can use pip install twitter to install the twitter library for Python. You can refer to the documentation here: https://pypi.python.org/pypi/twitter .

Thanks,
Karan