vanshksingh / Pi5Neo

Library to Control Neopixel on Raspberry Pi 5 using python
MIT License
10 stars 5 forks source link

Can import pi5neo #6

Open mikecanann opened 14 hours ago

mikecanann commented 14 hours ago

ImportError: cannot import name 'Pi5Neo' from partially initialized module 'pi5neo' (most likely due to a circular import) (/home/mikec/src/light_project/pi5neo.py)

vanshksingh commented 13 hours ago

Are you able to use basic example ? And you installed it in your system on venv or on system with --break-system flag ?

mikecanann commented 13 hours ago

I'm attempting to use the 10 line basic example. And I'm using venv

vanshksingh commented 12 hours ago

I would suggest you try to install it to the system itself pip install pi5neo --break-system or pip3 install pi5neo --break-system don't forget to enable spi

use GPIO 10 and connect the ground to raspi too if using external power

mikecanann commented 10 hours ago

Tried that, still getting the issue:

$ python3 pi5neo.py Traceback (most recent call last): File "/home/mikec/src/pi5neo.py", line 2, in from pi5neo import Pi5Neo File "/home/mikec/src/pi5neo.py", line 2, in from pi5neo import Pi5Neo ImportError: cannot import name 'Pi5Neo' from partially initialized module 'pi5neo' (most likely due to a circular import) (/home/mikec/src/pi5neo.py)

I also have the GPIO set to 10 (and configured and turned on in the OS), and the ground is also connected to the raspberry pi 5

mikecanann commented 9 hours ago

By the way, I have this working with neopixel_spi. I can use the examples from that project and the lights work.

vanshksingh commented 8 hours ago

Change your filename from pi5neo.py to something else

from pi5neo import Pi5Neo here it trying to find the module from the script you are running itself thats why the issue

mikecanann commented 7 hours ago

Thank you for your help! And sorry for such a beginners mistake.