Blinkt! software can't be installed: error: externally-managed-environment

When installing the software needed for the Blinkt! LED board as described in your instructions, I always get an error message like this:

Installing Blinkt! 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.

[…}

hint: See PEP 668 for the detailed specification.
Python 3 library install failed!
If problems persist, visit forums.pimoroni.com for support

I opted in for a full installation incl. docs and examples. What did NOT help:

  • Using sudo when installing: sudo curl https://get.pimoroni.com/blinkt | bash
  • Installing Python 3 in full beforehand: sudo apt-get install python3-full

I’ve got a Pi Zero with the official 32-bit version of Raspi OS I wrote on the SD card by using the Raspi imager. This is my system version: Linux pizero 6.6.51+rpt-rpi-v6 #1 Raspbian 1:6.6.51-1+rpt3 (2024-10-08) armv6l GNU/Linux

A Stack Overflow thread says something about the need to install Python in a venv, but this is hard and tedious work.

What is wrong here?

Dirty way:
sudo mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old

Adjust to your python (main) version (see python -V).

Is there no clean way? The dirty one would get overwritten after every update of the Python subsystem.

Try installing from this branch - I think the repackaged installer should try and set up a venv for you if you don’t have one:

You’ll need to activate the virtual environment before running examples, with

source ~/.virtualenvs/pimoroni/bin/activate

OK, thank you. Installation works now without errors, but the LEDs still don’t show anything.