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

unable to import pixel_ring #6

Open
yash2607 opened this issue Feb 1, 2019 · 9 comments
Open

unable to import pixel_ring #6

yash2607 opened this issue Feb 1, 2019 · 9 comments

Comments

@yash2607
Copy link

yash2607 commented Feb 1, 2019

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

@xiongyihui
Copy link
Contributor

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

sudo pip install pixel-ring

@slowmotion85
Copy link

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
Copy link

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

@sghoruiCinedigmInd
Copy link

sghoruiCinedigmInd commented Jul 2, 2019

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'

@alanroche2015
Copy link

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
Copy link

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.

@sghoruiCinedigmInd
Copy link

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.

@xcraftster
Copy link

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

@DivanX10
Copy link

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

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

7 participants