pixel_ring icon indicating copy to clipboard operation
pixel_ring copied to clipboard

unable to import pixel_ring

Open yash2607 opened this issue 6 years ago • 9 comments

I have performed everything that is mentioned but still I am not able to import pixel_ring . I am sharing the error below

pi@raspberrypi:~/pixel_ring $ sudo python examples/respeaker_4mic_array.py Traceback (most recent call last): File "examples/respeaker_4mic_array.py", line 9, in from pixel_ring import pixel_ring ImportError: No module named pixel_ring

yash2607 avatar Feb 01 '19 14:02 yash2607

When using sudo to run the example, you should install pixel_ring with sudo.

sudo pip install pixel-ring

xiongyihui avatar Feb 11 '19 05:02 xiongyihui

Hello, I am trying to setup the respeaker 6-mic array to be used with snips. Microphone is working perfectly, but i have the same error when trying to activate the example to test pixel ring. when trying to install pixel-ring i have the following return:

Requirement already satisfied: pixel_ring in ./pixel_ring (0.1.0)
Requirement already satisfied: pyusb in /usr/local/lib/python3.5/dist-packages (from pixel_ring) (1.0.2)
Requirement already satisfied: spidev in /usr/local/lib/python3.5/dist-packages (from pixel_ring) (3.4)

Any help would be appreciated, Thank you.

slowmotion85 avatar Mar 13 '19 00:03 slowmotion85

Hi again, So i managed to get this to work using python3 instead of python when running the script.

slowmotion85 avatar Mar 16 '19 16:03 slowmotion85

I installed pixel-ring. I tried python3. But still getting the same error -

$ sudo python3 examples/respeaker_4mic_array.py
Traceback (most recent call last):
  File "examples/respeaker_4mic_array.py", line 9, in <module>
    from pixel_ring import pixel_ring
ModuleNotFoundError: No module named 'pixel_ring'

sghoruiCinedigmInd avatar Jul 02 '19 19:07 sghoruiCinedigmInd

Hello,

I’m also having the same problem, if I download the pixel_ring package and load the examples from the folder everything works as expected. If I install the package using PIP while I can import pixel_ring when trying to use .wakeup() or other functions its says ‘module ‘ object has no attribute ...

Anyone find a fix yet ?

alanroche2015 avatar Jul 02 '19 21:07 alanroche2015

Hello,

I’m also having the same problem, if I download the pixel_ring package and load the examples from the folder everything works as expected. If I install the package using PIP while I can import pixel_ring when trying to use .wakeup() or other functions its says ‘module ‘ object has no attribute ...

Anyone find a fix yet ?

Ignore my question.. fixed. I was being silly and running the test program from a folder where it has a ‘pixel_ring’.. all working as expected now.

alanroche2015 avatar Jul 02 '19 21:07 alanroche2015

I installed pixel-ring. I tried python3. But still getting the same error -

$ sudo python3 examples/respeaker_4mic_array.py
Traceback (most recent call last):
  File "examples/respeaker_4mic_array.py", line 9, in <module>
    from pixel_ring import pixel_ring
ModuleNotFoundError: No module named 'pixel_ring'

Fixed this issue by removing everything and installing from scratch.

sghoruiCinedigmInd avatar Jul 03 '19 07:07 sghoruiCinedigmInd

I have the same problem. Here is my output

pi@raspberrypi:~/pixel_ring $ python3 examples/usb_mic_array.py Traceback (most recent call last): File "examples/usb_mic_array.py", line 7, in <module> from pixel_ring import pixel_ring File "/home/pi/pixel_ring/pixel_ring/__init__.py", line 13, in <module> pixel_ring = PixelRing() File "/home/pi/pixel_ring/pixel_ring/apa102_pixel_ring.py", line 22, in __init__ self.dev = APA102(num_led=self.PIXELS_N) File "/home/pi/pixel_ring/pixel_ring/apa102.py", line 90, in __init__ self.spi.open(bus, device) # Open SPI port 0, slave device (CS) 1 FileNotFoundError: [Errno 2] No such file or directory

xcraftster avatar Mar 16 '20 02:03 xcraftster

I also had such mistakes and I tried different options, but it turned out that I just had to follow this instruction and it worked for me. What did I do to make it work?

After installing the image, we update all packages

apt-get update && apt-get upgrade

Then we do as indicated in the documentation ReSpeaker_Core_v2.0

Play with GPIO This part will introduce how to use MRAA and UPM to control GPIO and Grove Socket on Respeaker Core v2.0.

Step 1. Update MRAA and UPM libraries to latest version At first, we need to install the latest MRAA and UPM packages.

sudo apt install python-mraa python-upm libmraa1 libupm1 mraa-tools

Next, we check the availability of pins, if there are no pins, then Pixel Ring will not work

mraa-gpio list

image

If there are pins, then we continue and install Pixel Ring, but before installing Pixel Ring, you need to install setuptools-scm

pip install setuptools-scm

We put Pixel Ring

git clone --depth 1 https://github.com/respeaker/pixel_ring.git
cd pixel_ring
pip install -U -e .

Run the python script for respeaker_v2_pixel_ring.py and admire the work of LED

python examples/respeaker_v2_pixel_ring.py

image image

DivanX10 avatar Mar 21 '23 02:03 DivanX10