Adafruit_CircuitPython_NeoPixel icon indicating copy to clipboard operation
Adafruit_CircuitPython_NeoPixel copied to clipboard

No Module Named adafruit_pixelbuf

Open polyphonic13 opened this issue 3 years ago • 2 comments

The adafruit_pixelbuf module is not found when running on a 2022 Raspberry Pi 4, with Raspbian OS.

Steps to Reproduce:

  1. Install with sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel
  2. Create python script (this was named "eye_lights01.py") that leverages NeoPixel with import neopixel (or from neopixel import * -- tried multiple demo scripts)
  3. Run script with sudo python3 eye_lights01.py

Expected Result: AdaFruit lights do lighting things Actual Result: bug thrown from "neopixel.py" script:

  ...
  File "usr/local/lib/python3.9/dist-packages/neopixel.py", line 20 in <module>
    import adafruit_pixelbuf
ModuleNotFoundError: No module named 'adafruit_pixelbuf'

polyphonic13 avatar Aug 14 '22 14:08 polyphonic13

There's a typo (there is no - in circuitpython) but I assume that's only here, since I can reproduce the issue. Tested in a venv, it also did not install Blinka (which you probably already had).

python3 -m venv venv
source venv/bin/activate
pip install rpi_ws281x adafruit-circuitpython-neopixel
>>> import neopixel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/circuit/tests/venv/lib/python3.7/site-packages/neopixel.py", line 16, in <module>
    import board
ModuleNotFoundError: No module named 'board'
>>> 

You can install the missing dependency manually:

sudo pip3 install adafruit-circuitpython-pixelbuf

Neradoc avatar Aug 14 '22 15:08 Neradoc

Thank you! adafruit-circuitpython-pixelbuf was the dependency name that I couldn't figured out. I'd tried adafruit-pixelbuf and pixelbuf with no luck.

There's a typo (there is no - in circuitpython) Correct. That was only in this post. Edited original to correct.

polyphonic13 avatar Aug 14 '22 15:08 polyphonic13

This is due to an issue with pyproject.toml not including requirements.txt during the build/upload step, I believe. This should be fixed with #135 which will make sure those files are added when the source and built distributions are created.

tekktrik avatar Aug 17 '22 01:08 tekktrik