question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installation on Raspberry Pi OS Lite (bullseye) aborts with an error

See original GitHub issue

First of all thanks for all your effort! Your work is greatly appreciated!

I’ve been using the luma.led_matrix package for quite a while without any issues on an RPI 3B with Raspberry Pi OS Lite (buster). Now I tried the latest Raspberry Pi OS Lite (bullseye) release (same hardware, setup from scratch). Unfortunately the installation of luma.led_matrix package aborts with an error. Seems there is a problem with ws2812.

Any ideas?

Type of Raspberry Pi

Raspberry Pi 3 Model B V1.2

Linux Kernel version

Linux 5.10.63-v7+ #1459 SMP Wed Oct 6 16:41:10 BST 2021 armv7l GNU/Linux Raspbian GNU/Linux 11 (bullseye)

Python 3.9.2

Expected behaviour

successful installation with

sudo python3 -m pip install --upgrade luma.led_matrix

Actual behaviour

sudo usermod -a -G spi,gpio pi sudo apt install build-essential python3-dev python3-pip libfreetype6-dev libjpeg-dev libopenjp2-7 libtiff5 sudo -H pip install --upgrade --ignore-installed pip setuptools

runs without error, but …

sudo python3 -m pip install --upgrade luma.led_matrix

gives

ERROR: Failed building wheel for ws2812

see details here: https://pastebin.com/raw/TRquDVmd

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:48

github_iconTop GitHub Comments

2reactions
thijstriemstracommented, Nov 27, 2021

So the ws2812 package’s last release was on Oct 7, 2014: https://pypi.org/project/ws2812/

It’s homepage is listed as (a redirect to) https://github.com/pimoroni/unicorn-hat

The documentation there calls it the unicornhat package:

sudo pip3 install unicornhat

but also mentions it requires the rpi_ws281x library:

Note this library requires the rpi_ws281x Python library which you can find here: https://github.com/pimoroni/rpi_ws281x-python

luma.led_matrix currently requires the following libraries:

install_requires =
    luma.core>=2.2.0
    ws2812; platform_machine=="armv7l" and platform_system=="Linux"
    rpi_ws281x; platform_machine=="armv7l" and platform_system=="Linux"

I can only find an import refererencing the rpi_ws281x library in the source code:

    def __ws281x__(self):
        import _rpi_ws281x
        return _rpi_ws281x

I also did a search for unicornhat imports in luma.led_matrix but couldn’t find any.

This all leads me to believe that the ws2812 library is not needed (fortunately). I created #264 that removes the dependency.

1reaction
linuxmintycommented, Dec 3, 2021

Hello Thijs–Success!!! Your guidance worked and the ZeroSeg is again displaying time and date on the Raspberry Pi with “Bullseye” installed. Thank you so much for taking the time to get this working for me!

One additional question, if I may: After making your suggested changes to setup.cnfg, I ran pip install -e . again and got the following:

Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Obtaining file:///home/pi/luma.led_matrix
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting rpi-ws281x
  Downloading https://www.piwheels.org/simple/rpi-ws281x/rpi_ws281x-4.3.1-cp39-cp39-linux_armv7l.whl (117 kB)
     |████████████████████████████████| 117 kB 333 kB/s            
Collecting luma.core>=2.2.0
  Downloading https://www.piwheels.org/simple/luma-core/luma.core-2.3.1-py2.py3-none-any.whl (71 kB)
     |████████████████████████████████| 71 kB 107 kB/s            
Requirement already satisfied: smbus2 in /usr/local/lib/python3.9/dist-packages (from luma.core>=2.2.0->luma.led-matrix==1.5.0) (0.4.1)
Requirement already satisfied: RPI.GPIO in /usr/lib/python3/dist-packages (from luma.core>=2.2.0->luma.led-matrix==1.5.0) (0.7.0)
Requirement already satisfied: deprecated in /usr/local/lib/python3.9/dist-packages (from luma.core>=2.2.0->luma.led-matrix==1.5.0) (1.2.13)
Requirement already satisfied: cbor2 in /usr/local/lib/python3.9/dist-packages (from luma.core>=2.2.0->luma.led-matrix==1.5.0) (5.4.2)
Requirement already satisfied: spidev in /usr/lib/python3/dist-packages (from luma.core>=2.2.0->luma.led-matrix==1.5.0) (3.5)
Requirement already satisfied: pyftdi in /usr/local/lib/python3.9/dist-packages (from luma.core>=2.2.0->luma.led-matrix==1.5.0) (0.53.3)
Requirement already satisfied: pillow>=4.0.0 in /usr/lib/python3/dist-packages (from luma.core>=2.2.0->luma.led-matrix==1.5.0) (8.1.2)
Requirement already satisfied: wrapt<2,>=1.10 in /usr/lib/python3/dist-packages (from deprecated->luma.core>=2.2.0->luma.led-matrix==1.5.0) (1.12.1)
Requirement already satisfied: pyusb!=1.2.0,>=1.0.0 in /usr/local/lib/python3.9/dist-packages (from pyftdi->luma.core>=2.2.0->luma.led-matrix==1.5.0) (1.2.1)
Requirement already satisfied: pyserial>=3.0 in /usr/lib/python3/dist-packages (from pyftdi->luma.core>=2.2.0->luma.led-matrix==1.5.0) (3.5b0)
Installing collected packages: rpi-ws281x, luma.core, luma.led-matrix
  Running setup.py develop for luma.led-matrix
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/pi/luma.led_matrix/setup.py'"'"'; __file__='"'"'/home/pi/luma.led_matrix/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
         cwd: /home/pi/luma.led_matrix/
    Complete output (32 lines):
    running develop
    /usr/local/lib/python3.9/dist-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    WARNING: The user site-packages directory is disabled.
    /usr/local/lib/python3.9/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    error: can't create or remove files in install directory
    
    The following error occurred while trying to add or remove files in the
    installation directory:
    
        [Errno 13] Permission denied: '/usr/local/lib/python3.9/dist-packages/test-easy-install-4345.write-test'
    
    The installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:
    
        /usr/local/lib/python3.9/dist-packages/
    
    Perhaps your account does not have write access to this directory?  If the
    installation directory is a system-owned directory, you may need to sign in
    as the administrator or "root" account.  If you do not have administrative
    access to this machine, you may wish to choose a different installation
    directory, preferably one that is listed in your PYTHONPATH environment
    variable.
    
    For information on other options, you may wish to consult the
    documentation at:
    
      https://setuptools.pypa.io/en/latest/deprecated/easy_install.html
    
    Please make the appropriate changes for your system and try again.
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/pi/luma.led_matrix/setup.py'"'"'; __file__='"'"'/home/pi/luma.led_matrix/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.

Due to the above reference to “permission denied,” I then tried sudo pip install -e . and it worked. My only concern is the concluding warning of that successful output:

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Does this pose a problem for future use of the system package manager?

Again, thank you very much for your excellent support!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update of PI OS failed - Raspberry Pi Forums
I have installed, run and update/upgraded RasPiOS Bullseye [32] ... exact error inside a systemd-nspawn updating the not (lite or full) IMG.
Read more >
Installation fails on raspios 64bit #66 - pimox/pimox7 - GitHub
Hello, i have tried like 20 times to install pimox but the error is always the same: Done. Loading new ceph-dkms-0.0.2 DKMS files....
Read more >
Raspberry Pi 4 Wont Boot Fix. Bootloader Update. - YouTube
Raspberry Pi 4 Wont Boot Fix. Bootloader Update.My Raspberry Pi was intermittently no booting. The screen wouldn't show up.
Read more >
7 Causes for a Raspberry Pi That Won't Boot (And How to Fix ...
Raspberry Pi won't boot? New Raspberry Pi 4 not booting, with no red or green lights? Try these Raspberry Pi troubleshooting tips.
Read more >
How to Install ROS Noetic on Raspberry Pi 4 - VarHowto
1. Run this echo command to add the official ROS Noetic repo to source list: sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu buster main"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found