Problem after updating Python

Hi

I’ve been using the GrovePi with the Pi 3 for a couple of weeks now without any problems. Today I was running into ssl troubles with a script that parses emails. I found a solution online that had me update python to version 2.7.11. I’m not very familiar with linux but all seemed to go as planned. When I start python it shows version 2.7.11. But now all my grovepi scripts don’t work properly anymore. If I start python and enter import grovepi it tells me there is no module grovepi (or smbus).

any ideas on how to solve this?

Hey DennisS,
I am not really sure what’s in the LOG.txt. Can you paste the error that you are getting. Also, what image are you using with the Raspberry Pi. Is it Raspbian for robots or your own image.

-Karan

Hi Karan,

Below is what I get. This happened after updating python to 2.7.11. I’m sure it has to do with paths etc. but I have no idea how to solve this. All was working fine before updating python. I’m using a RPi3 with a standard Raspian image that was ‘converted’ to Raspbian for robots with the scripts on github.

Dennis

pi@raspberrypi:~ $ python
Python 2.7.11 (default, Mar 15 2016, 08:55:52)
[GCC 4.9.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import grovepi
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
ImportError: No module named grovepi

I think the grovepi module might have been removed systemwide. Can you run setup.py from here: https://github.com/DexterInd/GrovePi/tree/master/Software/Python by: sudo python setup.py install and see if that helps.

Also, how is the GrovePi working with the Pi3. Any hiccups. Are you using your own image or the DexterIndustries image.

-Karan

Thanks Karan,

Now I’m getting ‘No module named smbus’. I’ll just have to go through a reinstall I guess. No problem.

So far I’ve not seen any hiccups or unexpected behaviour. The Raspian for Robots image won’t boot on the Pi 3. You need to include the bootfiles from the latest NOOBS 1.8 (If memory serves me right I have unpacked the boot.tar.xz file and used bcm2710-rpi-3… and the .elf files).

Dennis

I think I’ve found part of the problem and a solution on another forum. Maybe it will help others:

After inspecting sys.path I’ve realized that the interpreter was loaded from a wrong location (/usr/local/bin instead of /usr/bin/), so I did:

sudo rm -rf /usr/local/bin/python*
And now it works again! The problem was rooted in the fact that /usr/local/bin precedes /usr/bin in the PATH variable. Now it’s using python 2.7.9 again instead of the updated 2.7.11. So I’m back at the beginning, but everything is working at least.

Dennis

Hey DennisS,
Thanks a lot for letting us know about it. Didn;t know that /usr/local/bin had a higher priority than /usr/bin/. This would surely help others too.

-Karan