jcarbaugh / python-roku

Screw remotes. Control your Roku with Python.
https://pypi.python.org/pypi/roku
BSD 3-Clause "New" or "Revised" License
288 stars 94 forks source link

Using python-roku generates a circular reference error when running initial code #91

Closed HumptyDumptyNumpty closed 1 year ago

HumptyDumptyNumpty commented 1 year ago

My apologies if I am being a numpty, but I am new to this, so thought I would start with something simple.

I used pip install python-roku successfully.

I then thought I would try to generate some code that I could expand upon:-

#!/usr/bin/python3

from roku import Roku

myroku = Roku('192.168.10.163')

I changed the example from e.g. "roku = Roku..." to "myroku = Roku..." to ensure it wasn't this generating the error.

The error I get is:-

./roku.py Traceback (most recent call last): File "./roku.py", line 3, in <module> from roku import Roku File "<dirpath>/roku.py", line 3, in <module> from roku import roku ImportError: cannot import name 'roku' from partially initialized module 'roku' (most likely due to a circular import) (<dirpath>/roku.py) I have tried all I can think of (which isn't much!) and cannot find an answer on the internet, so any help would be most appreciated.

I have tried this on two computers (both Ubuntu 20.04 or 22.04) in case it was an install issue...

Many thanks,

HumptyDumptyNumpty commented 1 year ago

My apologies, I tried to edit my question but was unable to - but the error should have read:-

./roku.py 
Traceback (most recent call last):
  File "./roku.py", line 3, in <module>
    from roku import Roku
  File "<dirpath>/roku.py", line 3, in <module>
    from roku import Roku
ImportError: cannot import name 'Roku' from partially initialized module 'roku' (most likely due to a circular import) (<dirpath>/roku.py)

Many thanks for your help.