You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to get data out of my inverter but I seem unable to import the SungrowInverter library.
pip3 successfully installed both SungrowModbusTcpClient-0.1.6 and SungrowInverter-0.1.7 but when I try to import the module I get a TypeError that I am unable to figure out the reason for.
`PI:~# python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from sungrowinverter import SungrowInverter
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/dist-packages/sungrowinverter/init.py", line 4, in
from sungrowinverter.SungrowInverter import SungrowInverter
File "/usr/local/lib/python3.7/dist-packages/sungrowinverter/SungrowInverter.py", line 16, in
from sungrowinverter.configs.inverter import (
File "/usr/local/lib/python3.7/dist-packages/sungrowinverter/configs/inverter.py", line 21, in
ModBusRegister(5001, "nominal_output_power", "U16", 0.1, KILO_WATT),
TypeError: 'type' object is not subscriptable
`
The text was updated successfully, but these errors were encountered:
After some additional trolling on the Internet, I realized that the problem is that the code is using type hinting, which was introduced in python 3.9. The setup.cfg file incorrectly lists python >= 3.5 as requirements.
The workaround, if you would like to avoid upgrading python, is to use the typing library to avoid problems with generic typing. See example diff for configs/inverter.py;
I would like to get data out of my inverter but I seem unable to import the SungrowInverter library.
pip3 successfully installed both SungrowModbusTcpClient-0.1.6 and SungrowInverter-0.1.7 but when I try to import the module I get a TypeError that I am unable to figure out the reason for.
`PI:~# python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
The text was updated successfully, but these errors were encountered: