My neopixels aren't working when I run them, I am using curcuitpython and using all libraries required

import neopixel
from adafruit_led_animation.animation.solid import Solid
from adafruit_led_animation.color import RED

pixel_pin = board.GP0
pixel_num = 8

pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.2, auto_write=False)

I keep getting this in the console

TypeError: function missing required positional argument #3

The same thing happens when I try normal neopixel code

import time
import board
from rainbowio import colorwheel
import neopixel

# Update this to match the number of NeoPixel LEDs connected to your board.
num_pixels = 8

pixels = neopixel.NeoPixel(board.GP0, num_pixels, auto_write=False)
pixels.brightness = 0.5

def rainbow(speed):
    for j in range(255):
        for i in range(num_pixels):
            pixel_index = (i * 256 // num_pixels) + j
            pixels[i] = colorwheel(pixel_index & 255)

while True:

I would really appreciate if someone could help. PLEASE

  • 3
    Quick guess -- this: neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.2, is missing an argument in between pixel_num and brightness=.
    – goldilocks
    Jan 18, 2022 at 16:12
  • Maybe, I only recently joined the python community and have very little experience with it. Jan 18, 2022 at 18:09
  • This is code from the adafruit website and I plan to modify it when it's fixed Jan 18, 2022 at 18:21
  • which version of circuitpython are you running?
    – Bravo
    Jan 18, 2022 at 22:56
  • I am running 7.1.1 Jan 18, 2022 at 22:58

1 Answer 1


Just check that you have the neopixel.py file installed in the lib folder of the circuitpy device, not the neopixel.mpy


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.