Installing BME680 Breakout library for Python 3 FAILS

Hi all,
I am trying to setup the BME688 Air Sensor on my Raspberry Pi 3 Model B Rev 1.2 running bookworm (downloaded and installed 16/3/24).
As i am general noob i opted for the “quick and painless one-line-installer”(Sorry limited on links as new user) as mentioned on the BME688 Air Sensor page.
The bash script is failing.

Installing BME680 Breakout library for Python 3...

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Python 3 library install failed!
If problems persist, visit forums.pimoroni.com for support

I have tried to research this but am struggling with what to change in the script. Something appears to be outdated in the code that relates to the use of using pip3 and the most recent Raspberry OS.
I found this post has an answer that descrbes the issue in detail

Your distribution is trying to protect you against mixing apt provided packages and pip provided packages. Mixing two package managers (apt and pip here) is always a bad idea and the source of many issues.

I guess the quick solution will be to try and older rasbian OS release as something needs amending in the current provided soution.

Thanks

BAB

Edit wouldnt work, 422 error, whatever that is…

*Edit - Just tried previous rasp OS but the script breaks on old OS images

Note: BME680 Breakout requires I2C communication

Do you wish to continue? [y/N] y

Checking environment...
Updating apt indexes...
.....................E: Repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' changed its 'Suite' value from 'stable' to 'oldoldstable'
E: Repository 'http://archive.raspberrypi.org/debian buster InRelease' changed its 'Suite' value from 'testing' to 'oldoldstable'
Apt failed to update indexes!

So i guess that makes this sensor useless for us newbies, at least while the script is broken.

Which old OS did you install? I select “Pi OS Legacy” from the list and haven’t had any issues with the current Pimoroni installers. I haven’t used the BME680 one just yet though.

If you go back too far you may install a version that has been archived. As far as I know, that does break things update wise?

Virtual Environments, Libgpiod, gpiodevice and the current mess I’m making of our Python libraries - Support - Pimoroni Buccaneers

Awesome! legacy OS worked! thanks!

1 Like