moses-palmer / pystray

GNU General Public License v3.0
479 stars 59 forks source link

The basic icon display program isn't working #144

Closed nav9 closed 1 year ago

nav9 commented 1 year ago

Tried the program here. It shows the error:

Traceback (most recent call last):
  File "/home/nav/code/pystray.py", line 1, in <module>
    import pystray
  File "/home/nav/code/pystray.py", line 21, in <module>
    icon = pystray.Icon(
AttributeError: partially initialized module 'pystray' has no attribute 'Icon' (most likely due to a circular import)  

Is anyone still maintaining this project? It's a good project, but there appear to be a lot of issues pending.

moses-palmer commented 1 year ago

Thank you for your report.

Yes, this project is still maintained.

I think this may be due to name conflicts: have you tried renaming your script file to something other than pystray.py? I will preemptively close this issue; please reopen if this was not the cause.

nav9 commented 1 year ago

You are right. It works when I rename the file. Perhaps a check could be added to see if the filename is pystray.py, and throw an error that the User needs to rename the file. One more thing. I was trying out the other programs on this page, and realized that the code samples are not standalone. One program calls the create_image function, but I have to scroll to the top of the page to copy the create_image function and re-include it in the code, and then I realize that the program uses the function without sending any parameters to it, but the first create_image function takes 4 parameters. It really would help to create code samples that the users can simply copy paste and try out. That's how at least I evaluate a library. Nice library though.