Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4421

Troubleshooting • (Raspberry Pi) Running ws2812 REG LED shows an error: AttributeError: module 'neopixel' has no attribute 'NeoPixel'

$
0
0
I used a virtual environment to run the program, but the code gave this error.

This is my code, very simple:

Code:

import boardimport neopixelpixels = neopixel.NeoPixel(board.D18, 1)pixels[0] = (10, 0, 0)
I have tried this solution:
https://forums.adafruit.com/viewtopic.p ... 1&start=15

But it doesn't work. I use the command line python to enter:

Code:

import neopixeldir(neopixel)
And I got:
['Controller', 'Energy', 'ExpFilter', 'Microphone', 'Sampler', 'Scroll', 'Source', 'Spectrum', 'Visualizer', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'controller', 'dsp', 'energy', 'melbank', 'microphone', 'sampler', 'scroll', 'source', 'spectrum', 'visualizer']
Strange, there is no error here, but when I run the file, an error occurs. (I run it with Python in a virtual environment from beginning to end)

This is my wiring: Is my wiring wrong?
20241223174825.jpg
20241223174824.jpg

Statistics: Posted by ricky2777 — Mon Dec 23, 2024 9:56 am — Replies 2 — Views 66



Viewing all articles
Browse latest Browse all 4421

Trending Articles