Error trying to install the BME680 library in Mac

Hello all, This might be something silly but it is my first time programming micro controllers.
I just tried to connect a Raspberry Pico W to a Pimoroni Breakout BME680.

I was following: Getting Started with BME680 Breakout
This documentation assumes you have a Raspberry Pi I think, so I tried the manual install.

Basically as follows:

cd libraries
git clone https://github.com/pimoroni/bme680
cd bme680/library
sudo python3 setup.py install // I don't have python as that in Mac but I have python3 that should be ok

After this I get this error:

running install
running bdist_egg
running egg_info
creating bme680.egg-info
writing bme680.egg-info/PKG-INFO
writing dependency_links to bme680.egg-info/dependency_links.txt
writing requirements to bme680.egg-info/requires.txt
writing top-level names to bme680.egg-info/top_level.txt
writing manifest file 'bme680.egg-info/SOURCES.txt'
reading manifest file 'bme680.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'bme680.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.9-universal2/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/bme680
copying bme680/constants.py -> build/lib/bme680
copying bme680/__init__.py -> build/lib/bme680
creating build/bdist.macosx-10.9-universal2
creating build/bdist.macosx-10.9-universal2/egg
creating build/bdist.macosx-10.9-universal2/egg/bme680
copying build/lib/bme680/constants.py -> build/bdist.macosx-10.9-universal2/egg/bme680
copying build/lib/bme680/__init__.py -> build/bdist.macosx-10.9-universal2/egg/bme680
byte-compiling build/bdist.macosx-10.9-universal2/egg/bme680/constants.py to constants.cpython-39.pyc
byte-compiling build/bdist.macosx-10.9-universal2/egg/bme680/__init__.py to __init__.cpython-39.pyc
creating build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying bme680.egg-info/PKG-INFO -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying bme680.egg-info/SOURCES.txt -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying bme680.egg-info/dependency_links.txt -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying bme680.egg-info/requires.txt -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying bme680.egg-info/top_level.txt -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/bme680-1.1.1-py3.9.egg' and adding 'build/bdist.macosx-10.9-universal2/egg' to it
removing 'build/bdist.macosx-10.9-universal2/egg' (and everything under it)
Processing bme680-1.1.1-py3.9.egg
Removing /Library/Python/3.9/site-packages/bme680-1.1.1-py3.9.egg
Copying bme680-1.1.1-py3.9.egg to /Library/Python/3.9/site-packages
bme680 1.1.1 is already the active version in easy-install.pth

Installed /Library/Python/3.9/site-packages/bme680-1.1.1-py3.9.egg
Processing dependencies for bme680==1.1.1
Searching for smbus
Reading https://pypi.org/simple/smbus/
Downloading https://files.pythonhosted.org/packages/4d/5c/70e14aa4f0c586efc017e1d1aa6e2f7921eefc7602fc2d03368ff912aa91/smbus-1.1.post2.tar.gz#sha256=f96d345e0aa10053a8a4917634f1dc37ba1f656fa5cace7629b71777e90855c6
Best match: smbus 1.1.post2
Processing smbus-1.1.post2.tar.gz
Writing /tmp/easy_install-1_2thfpd/smbus-1.1.post2/setup.cfg
Running smbus-1.1.post2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-1_2thfpd/smbus-1.1.post2/egg-dist-tmp-pmkn4nff
building 'i2c' library
b"In file included from lib/smbus.c:16:\ninclude/i2c/smbus.h:19:10: fatal error: 'linux/types.h' file not found\n#include <linux/types.h>\n         ^~~~~~~~~~~~~~~\n1 error generated.\nmake: *** [lib/smbus.o] Error 1\n"
smbusmodule.c:26:10: fatal error: 'linux/i2c.h' file not found
#include <linux/i2c.h>
         ^~~~~~~~~~~~~
1 error generated.
error: Setup script exited with error: command '/usr/bin/clang' failed with exit code 1

Apparently cannot find linux/i2c.h Does anyone had this error? Does someone know how to solve it? I tried to look for it but I did not find anything that could solve it.

Full details of system:

  • Python 3: 3.9.6
  • MacOs: Ventura 13.2 (CPU Apple M2 Pro)
  • Raspberry Pi Pico W
  • BME680 breakout (pimoroni)

Thanks for your help :)

As you have figured out, those aren’t the installers you need. That’s the Pi Python stuff.
The Pico, Micro Python stuff is here.
pimoroni-pico/micropython at main · pimoroni/pimoroni-pico (github.com)

If your using the Pimoroni branded uf2 file, you already have all the libraries installed.
The demo / examples are here.
pimoroni-pico/micropython/examples/breakout_bme68x at main · pimoroni/pimoroni-pico (github.com)

On my Windows PC and Raspberry Pi PC’s I use Thonny as my IDE.

Morning mate,

Thanks for the links. Yeah I was wondering that probably the script was looking for Debian drivers and my system would obviously not have them but somehow I managed not find them in git.

I use pyCharm as IDE so I’ll require to have accessible the libraries so the IDE does not complain. I’ll have a look at the links this evening.

I’ll look for the uf2 from Pimoroni too so at least I know the pico has it.

Once all done I’ll update here in case someone has a similar setup, they can use this post as guide.

Thanks :)

One of the gotcha’s is the link on the product page for C++ and Micro Python takes you here.
pimoroni/pimoroni-pico: Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython. (github.com)

From there you still have to click “micropython” to get to the right spot. ;)