Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not get cli to run #35

Open
rtveng opened this issue Jan 29, 2021 · 5 comments
Open

can not get cli to run #35

rtveng opened this issue Jan 29, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@rtveng
Copy link

rtveng commented Jan 29, 2021

Thank you for this work. I am very excited to use it. I attempting to connect to a mate3s.

C:\Users\parker>mate3 devices -host 10.220.10.44
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\parker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts\mate3.exe\__main__.py", line 4, in <module>
  File "C:\Users\parker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\mate3\main.py", line 13, in <module>
    from mate3.api import Mate3Client
  File "C:\Users\parker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\mate3\api.py", line 8, in <module>
    from mate3.devices import DeviceValues
  File "C:\Users\parker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\mate3\devices.py", line 10, in <module>
    from mate3.sunspec.models import (
  File "C:\Users\parker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\mate3\sunspec\models.py", line 22, in <module>
    class CCconfigFaultsFlags(BitfieldDescriptionMixin, IntFlag):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\enum.py", line 131, in __prepare__
    member_type, first_enum = metacls._get_mixins_(cls, bases)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\enum.py", line 523, in _get_mixins_
    member_type = _find_data_type(bases) or object
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\enum.py", line 511, in _find_data_type
    raise TypeError('%r: too many data types: %r' % (class_name, data_types))
TypeError: 'CCconfigFaultsFlags': too many data types: [<class 'mate3.sunspec.fields.BitfieldDescriptionMixin'>, <class 'int'>]
@kodonnell
Copy link
Collaborator

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?

@kodonnell kodonnell added the bug Something isn't working label Jan 31, 2021
@matteing
Copy link

matteing commented Jun 2, 2021

Also experiencing this issue.

@maddiebeaton
Copy link

I can confirm it works on Python 3.7 but I get the same error on Python 3.8

@rrooggiieerr
Copy link

rrooggiieerr commented Feb 21, 2022

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: [email protected]
License: 
Location: /Users/rogier/Library/Python/3.9/lib/python/site-packages
Requires: fixedint, loguru, pymodbus
Required-by:

@BrettLHolmes
Copy link

BrettLHolmes commented Oct 13, 2023

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: [email protected]
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/[email protected]/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/[email protected]/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/[email protected]/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'>}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants