Open rtveng opened 3 years ago
Thanks for trying it out @rtveng ! I'm pretty sure this is something that happens in Python 3.8/3.9 - can you try on Python 3.7?
Also experiencing this issue.
I can confirm it works on Python 3.7 but I get the same error on Python 3.8
I've got the same problem.
Update 24 Jan 2022:
Seems that pip install mate3
installs an old version of the mate3 package which doesn't include the Python 3.8/3.9 fixes
pip show mate3
output:
Name: mate3
Version: 0.6.2
Summary: Outback Mate3s Python Library
Home-page: https://github.com/adamcharnock/mate3/
Author: Adam Charnock
Author-email: adam@adamcharnock.com
License:
Location: /Users/rogier/Library/Python/3.9/lib/python/site-packages
Requires: fixedint, loguru, pymodbus
Required-by:
Hi All
I see this Code was done some time ago and I was trying to run it on a Python 3.11 (on a Mac) and get the same issue as for version 3.8 and version 3.9 and before I start digging into this further wanted to see if any work was being done else where to resolve this or any advice for me. If this change here does resolve the pythod version issue then I need to figure out how to install it over the standard pip install mate3
PS
pip show mate3
Name: mate3
Version: 0.6.2
Summary: Outback Mate3s Python Library
Home-page: https://github.com/adamcharnock/mate3/
Author: Adam Charnock
Author-email: adam@adamcharnock.com
License:
Location: /opt/homebrew/lib/python3.11/site-packages
Requires: fixedint, loguru, pymodbus
Required-by:
the error
mate3
Traceback (most recent call last):
File "/opt/homebrew/bin/mate3", line 5, in <module>
from mate3.main import main
File "/opt/homebrew/lib/python3.11/site-packages/mate3/main.py", line 13, in <module>
from mate3.api import Mate3Client
File "/opt/homebrew/lib/python3.11/site-packages/mate3/api.py", line 8, in <module>
from mate3.devices import DeviceValues
File "/opt/homebrew/lib/python3.11/site-packages/mate3/devices.py", line 10, in <module>
from mate3.sunspec.models import (
File "/opt/homebrew/lib/python3.11/site-packages/mate3/sunspec/models.py", line 22, in <module>
class CCconfigFaultsFlags(BitfieldDescriptionMixin, IntFlag):
File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py", line 489, in __prepare__
member_type, first_enum = metacls._get_mixins_(cls, bases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py", line 958, in _get_mixins_
member_type = mcls._find_data_type_(class_name, bases) or object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py", line 998, in _find_data_type_
raise TypeError('too many data types for %r: %r' % (class_name, data_types))
TypeError: too many data types for 'CCconfigFaultsFlags': {<class 'mate3.sunspec.fields.BitfieldDescriptionMixin'>, <class 'int'>}
What's the fix for this?
Thank you for this work. I am very excited to use it. I attempting to connect to a mate3s.