Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh install isn't working #2

Closed
glitch003 opened this issue Feb 2, 2020 · 5 comments
Closed

Fresh install isn't working #2

glitch003 opened this issue Feb 2, 2020 · 5 comments

Comments

@glitch003
Copy link

Hi, thanks for making this awesome package!

I just did a fresh install on a brand new Raspbian installation and I'm getting the error below. Any ideas?

pi@raspberrypi:~/led-control $ sudo ledcontrol --led_count 15 /usr/local/lib/python3.7/dist-packages/_rpi_ws281x.cpython-37m-arm-linux-gnueabihf.so Traceback (most recent call last): File "/usr/local/bin/ledcontrol", line 11, in <module> load_entry_point('led-control', 'console_scripts', 'ledcontrol')() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2793, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2411, in load return self.resolve() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2417, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/home/pi/led-control/ledcontrol/__init__.py", line 7, in <module> from ledcontrol.app import create_app File "/home/pi/led-control/ledcontrol/app.py", line 10, in <module> from ledcontrol.animationcontroller import AnimationController File "/home/pi/led-control/ledcontrol/animationcontroller.py", line 12, in <module> import ledcontrol.animationpatterns as patterns File "/home/pi/led-control/ledcontrol/animationpatterns.py", line 8, in <module> import ledcontrol.rpi_ws281x as rpi_ws281x File "/home/pi/led-control/ledcontrol/rpi_ws281x/__init__.py", line 19, in <module> blackbody_to_rgb = rpi_ws281x.blackbody_to_rgb AttributeError: module '_rpi_ws281x' has no attribute 'blackbody_to_rgb'

@jackw01
Copy link
Owner

jackw01 commented Feb 7, 2020

I recently had an issue doing a fresh install of this and changed ledcontrol/rpi_ws281x/__init__.py to fix it, but I'm not sure why the fix was necessary or why it even fixed anything.

Can you try replacing the contents of /home/pi/led-control/ledcontrol/rpi_ws281x/__init__.py with this?

# led-control WS2812B LED Controller Server
# Copyright 2019 jackw01. Released under the MIT License (see LICENSE for details).

from .rpi_ws281x import PixelStrip, Color
from .lib.rpi_ws281x import (
    blackbody_to_rgb,
    blackbody_correction_rgb,
    wave_pulse,
    wave_triangle,      
    wave_sine,
    wave_cubic,
    plasma_sines,       
    plasma_sines_octave,
    perlin_noise_3d,    
)

__version__ = '4.2.2'

If this doesn't work, the issue is likely something with the build process for the C extension module.

@m-seker
Copy link

m-seker commented Jul 17, 2020

I get the following if I replace the contents of init.py:

/usr/local/lib/python3.7/dist-packages/_rpi_ws281x.cpython-37m-arm-linux-gnueabihf.so
Traceback (most recent call last):
  File "/usr/local/bin/ledcontrol", line 11, in <module>
    load_entry_point('led-control', 'console_scripts', 'ledcontrol')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/pi/led-control/ledcontrol/__init__.py", line 7, in <module>
    from ledcontrol.app import create_app
  File "/home/pi/led-control/ledcontrol/app.py", line 10, in <module>
    from ledcontrol.animationcontroller import AnimationController
  File "/home/pi/led-control/ledcontrol/animationcontroller.py", line 12, in <module>
    import ledcontrol.animationpatterns as patterns
  File "/home/pi/led-control/ledcontrol/animationpatterns.py", line 8, in <module>
    import ledcontrol.rpi_ws281x as rpi_ws281x
  File "/home/pi/led-control/ledcontrol/rpi_ws281x/__init__.py", line 5, in <module>
    from .lib.rpi_ws281x import (
  File "/home/pi/led-control/ledcontrol/rpi_ws281x/lib/rpi_ws281x.py", line 255, in <module>
    class color_hsv(_object):
  File "/home/pi/led-control/ledcontrol/rpi_ws281x/lib/rpi_ws281x.py", line 261, in color_hsv
    __swig_setmethods__["hue"] = _rpi_ws281x.color_hsv_hue_set
AttributeError: module '_rpi_ws281x' has no attribute 'color_hsv_hue_set'

Any idea ?

@WhiteyFord
Copy link

Great project mate ..... I'm having the exact same issue.

@jackw01
Copy link
Owner

jackw01 commented Aug 9, 2020

@WhiteyFord cannot reproduce, what version of Raspberry Pi OS are you running and are you following the exact setup instructions in README.md?

When I run it, the first line printed is /home/pi/led-control/_rpi_ws281x.cpython-37m-arm-linux-gnueabihf.so instead of /usr/local/lib/python3.7/dist-packages/_rpi_ws281x.cpython-37m-arm-linux-gnueabihf.so which indicates that something is different about how it was installed. The _rpi_ws281x binary does not end up in /usr/local/lib/python3.7/dist-packages on my test devices.

@jackw01
Copy link
Owner

jackw01 commented Sep 10, 2020

Got a chance to test this with a fresh install of the latest version of Raspberry Pi OS. It did not have any issues installing when I followed the directions in README.md.

@jackw01 jackw01 closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants