AlexandrErohin / TP-Link-Archer-C6U

Python package for API access and management for TP-Link Routers. See supported routers list
GNU General Public License v3.0
59 stars 22 forks source link

ImportError due to filename conflict with enum.py in tplinkrouterc6u #49

Closed swwgames closed 1 month ago

swwgames commented 1 month ago

Hi @AlexandrErohin, I encountered an error while testing new code for the Archer C1200 with the tplinkrouterc6u library. Here’s the error message:

  File "C:\Users\*\AppData\Local\Programs\Python\Python312\Lib\site-packages\tplinkrouterc6u\enum.py", line 1, in <module>
    from enum import Enum
ImportError: cannot import name 'Enum' from partially initialized module 'enum' (most likely due to a circular import) (C:\Users\*\AppData\Local\Programs\Python\Python312\Lib\site-packages\tplinkrouterc6u\enum.py)

This error is likely due to a filename conflict between enum.py in tplinkrouterc6u and Python's built-in enum module. The typical solution for this is to rename enum.py to avoid this conflict.

Would renaming enum.py to something like connection_enum.py be a suitable fix? Let me know if you also encounter this issue, or if there's a preferred way to address it.

Thanks!

AlexandrErohin commented 1 month ago

@swwgames Hi. Thank you for pointing to this I have fixed some issues today and renamed enum.py also