jath03 / openrgb-python

A python client for the OpenRGB SDK
GNU General Public License v3.0
112 stars 22 forks source link

Newbie question/error: ImportError: cannot import name 'OpenRGBClient' from partially initialized module 'openrgb' (most likely due to a circular import) #52

Closed Calimerorulez closed 2 years ago

Calimerorulez commented 2 years ago

Hi,

Just experimenting with Python, I'm trying to get the module working, but I'm getting the following error when running the sample code below:

from openrgb import OpenRGBClient
cli = OpenRGBClient()
root@charon:~# python3 openrgb.py 
Traceback (most recent call last):
  File "/root/openrgb.py", line 1, in <module>
    from openrgb import OpenRGBClient
  File "/root/openrgb.py", line 1, in <module>
    from openrgb import OpenRGBClient
ImportError: cannot import name 'OpenRGBClient' from partially initialized module 'openrgb' (most likely due to a circular import) (/root/openrgb.py)

Can you please point me in the right direction?

jath03 commented 2 years ago

Because your file is named openrgb.py, it's trying to import OpenRGBClient from that file, which is causing issues. Just name the file something else and it should work.

Calimerorulez commented 2 years ago

Thank you very much for pointing that out!