adafruit / Adafruit_CircuitPython_NeoPixel

CircuitPython drivers for neopixels.
MIT License
302 stars 98 forks source link

No Module Named adafruit_pixelbuf #134

Closed polyphonic13 closed 2 years ago

polyphonic13 commented 2 years ago

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'
Neradoc commented 2 years ago

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
polyphonic13 commented 2 years ago

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.

tekktrik commented 2 years ago

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.