ImportError: cannot import name 'SGP30' from 'sgp30'

I bought a sgp30 sensor.
When it arrived I tried to use it but so far no luck.

I tried to install using garden breakout installer, but it does not support sgp30.

I installed manually using instructions (there are two ways and both do not work)
Installation was successful but when I tried to run example, I see this error:

ImportError: cannot import name ‘SGP30’ from ‘sgp30’

I check is the package was installed using pip3 list. I can see:
sgp30 0.1.6

I check is sensor is detected
i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: 10 – -- – -- – -- – -- – -- – -- – -- –
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- 38 – -- – 3c – -- –
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- 58 – -- – -- – -- –
60: – -- – -- – -- – -- 68 – -- – -- – -- –
70: – -- – -- – -- 76 –
So all 6 sensors are detected and only sgp30 (58) has this issue

I am using Pi 3+ ( i upgraded the software to the newest version, Python 3.7.3, )

any idea what I could do wrong?

Did you run it via the python command or python3 command? If the former try the latter.

1 Like

python3 command ( I run everything on python3 (3.7.3) ) .

Try sudo pip3 install sgp30, if you haven’t already.

1 Like

I tried it already and even check is it installed (pip3 list) … all other boards are visible
I re-installed, re-plug it
I updated even raspberry pi even…

I can see the sensor itself in i2cdetect …

I’m out of ideas? You could go here and e-mail tech support directly. I’d put a link to this thread in thats e-mail.
https://shop.pimoroni.com/pages/contact-us

1 Like

I had to download directly from GitHub and uninstall the pip to fix this.

1 Like

I will try it again as I used sudo pip install sgp30 and second method (via GitHub) … but I will try it from GitHub again …

The good news. It works now.
What I did, in the end, is to uninstall packages and github version again
and try one more time with GitHub version and I restarted board … and it works :)

Thanks for help @dryfish and @alphanumeric!
Enjoy your black Friday hunting!