Skip to content

arcade-bonnet.sh install error on raspberry pi 5 with bookworm "externally managed environment" #313

@jareddonovan

Description

@jareddonovan

Script Command

sudo bash arcade-bonnet.sh

Operating System

Raspberry Pi OS (64-bit) (debian bookworm) with raspberry pi desktop.

Hardware

Raspberry Pi 5

Behavior

An error occurs when I run the script:

error: externally-managed-environment

Otherwise, the script appears to exit as expected and copies the configuration files to the right places. However, when I reboot the Pi, and test the arcade buttons they do not work.

Description

The full output contains some additional information which may be useful:

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.

I selected following options when the script first runs:

  • disable overscan: N
  • install GPIO utility: N

Otherwise, it is a fresh install of the operating system (from the raspberry PI imager) with no other added libraries or changes.

Other notes:

  • I2C is enabled via raspi-config
  • I'm confident it's not a wiring/hardware issue because the same arcade bonnet works on a Pi4 running the previous OS (bullseye), which did not have the externally managed environment restriction.

Additional information

I believe the error arises at line 114. When I comment this line out and run the script, it does not give the error (but obviously still does not work):

pip3 install evdev smbus

I tried several things to fix this. I re-ran the script, rebooted and tested the buttons again after each one, but no luck:

  • I deleted the EXTERNALLY-MANAGED file in /usr/lib/python3.11
  • I set up a python virtual environment python3 -m venv venv
  • I the arcade-bonnet.sh script to use pipx instead of pip to install evdev and smbus libraries.
  • I edited the arcade-bonnet.sh script to use apt install python3-evdev and apt-install python3-smbus

With all these, the libraries appear to install fine, but the buttons still don't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions