Problem installing Enviro software on Pi zero

Unfortunately that does not seem to have helped. Both commands reported that all were the newest version and nothing new was installed.

I’m kind of grasping at straws but if you did the curl bash install try this instead

git clone
cd enviroplus-python
sudo ./

I have tried both methods of installation with similar results. I get a series of error messages which endwith the following

No package ‘libffi’ found
c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
#include <ffi.h>
compilation terminated.
error: Setup script exited with error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1
Setting up i2c and SPI…

although it then appears to finish normally.
I cannot see any reference to i2cdevice in the error messages

I have also run a simple python test and do see the I2c active:

#!/usr/bin/env python

import smbus

bus = smbus.SMBus(1) # 1 indicates /dev/i2c-1

for device in range(128):

  except: # exception if read_byte fails


I have tried the same and only get 0x23 & 0x76
but I presume that is because I have an Enviro not an Enviro+ so fewer sensors.

My search for libffi took me here, not sure if it helps though.

i2cdetect -y 1 is what you can run from terminal.

For the + it’s
0x49: ADS1015
0x76: BME280
0x23: LTR559

I had a look at it and found it all a bit beyond my skill level but it may provide some help.

One thing you can do is report this on Pimoroni’s GitHub Page for the Enviro / Enviro+, in the issues section.

Running i2c detect is a nice quick way to see if its working. If its not turned on / enabled you’ll get an error as soon as you run it. Then see what you get. All zero’s or all the fields full are an indication of an issue.
As far as i2c goes, its a shared bus and can have multiple devices connected. You just can’t have two devices with the same address. Do that an neither one of them will work.

Many thanks for your help. I have finally got it working by installing the missing libffi module with

sudo apt-get install libffi-dev

having done that the enviroplus-python package installs without any error messages and after rebooting the demo programmes run as expected.

1 Like

That’s good to hear.

Best guess is the owner of the libffi repository has moved things around or changed something that has broken the Pimoroni installer.

Hi all. I’m struggling with this on my new enviro and enviro+ .

Have you found any way forward to get these working?


He did get his working, he says as much in his last post.
Start at the top and work down and see if anything posted helps.


I plan to image a new sd card with Raspian Full desktop and start from scratch.

I plan to go through the post, from top to bottom and gather all the notes, what to install etc and build a process document then work to get this going and hopefully contribute back here with what worked etc.

Question. Did all the example scripts work? I’m trying to figure out what to expect as working and not working.

Some of the examples will only work if you also have the PMS5003 Particulate Matter Sensor. Just keep that in mind. It shouldn’t be too hard to look at the code to see if its listed or not. I don’t own an Enviro or Enviro +, just so you know.
I will be playing around with a BME280 and that same 0.96 LCD display and trying to run some of the Enviro+ examples on with them. I’m just waiting for them to arrive.


I don’t have the PMS5003…yet. Ill be ordering one soon though.

I would think if you can get the file to run your good to go.

1 Like

Ok…a quick follow up. So my second fresh start has worked much better.

TLDR: The Curl command method worked much better for me this time.

I did a fresh SD card image with full raspbian buster desktop install to a Pi Zero W.
I did an apt update and dist-upgrade.

I tried for the first time; the All-in-One Curl bash install command . Previously I used the git method.

The All-in-One curl command seems to have worked with very little editing of the examples scripts.

And I got the “” script to work this time around. However “python3” works where “python” fails with a syntax error.



So last night I installed my Enviro PHAT on my Pi 4 and couldn’t get the LCD to work. After a fresh install of Raspbian and Enviro via the curl method everything works perfectly. I wonder if the script setup is borked by other software installs which modify packages.


I’ve had very similar issues with the enviro (the white zero sized non + version

I found that it the worked when the installation was done from a terminal within the raspian desktop environment, rather than headless using ssh. There was still an error message during the install, but the examples I needed all worked