Description
Got the error out of the box running the module with basic example
Traceback (most recent call last):
File "/Users/wotori/git/foam/weintek/pycomm3.py", line 1, in <module>
from pycomm3 import LogixDriver
File "/Users/wotori/git/foam/weintek/pycomm3.py", line 1, in <module>
from pycomm3 import LogixDriver
ImportError: cannot import name 'LogixDriver' from partially initialized module 'pycomm3' (most likely due to a circular import) (/Users/wotori/git/foam/weintek/pycomm3.py)
Code SampleMinimal reproduceable code sample
from pycomm3 import LogixDriver
with LogixDriver('10.34.40.82') as plc:
print(plc)
# OUTPUT:
# Program Name: PLCA, Device: 1756-L83E/B, Revision: 28.13
print(plc.info)
This is because your script is named pycomm3.py, so Python is trying to import LogixDriver from the current script and not the library. If you rename your script it should work.
Pre-checks
Description Got the error out of the box running the module with basic example
Code Sample Minimal reproduceable code sample