AnotherDaniel / smahub

SMAHub is a flexible and modular solution for collecting data from SMA photovoltaic (PV) products and publishing it to various output channels, such as MQTT.
GNU General Public License v2.0
31 stars 11 forks source link

ha_mqtt_discoverable not found #11

Closed superurban closed 1 year ago

superurban commented 1 year ago

I'm sure it's me. I followed the steps outlined in the readme, but it gives me this error:

ERROR: Could not find a version that satisfies the requirement ha_mqtt_discoverable~=0.9 (from smahub) ERROR: No matching distribution found for ha_mqtt_discoverable~=0.9

Any ideas on how to fix it?

AnotherDaniel commented 1 year ago

Hm, not really - I am not a great Python expert, other than also noting a certain brittleness of it all :-\ - the ha_mqtt_discoverable package seems to be available as usual: https://pypi.org/project/ha-mqtt-discoverable/

Can you try performing a manual installation of that package in your environment? (pip3 install ha-mqtt-discoverable should to the trick). Alternatively, you can use the containerised version of smahub, that comes with everything built and ready.

superurban commented 1 year ago

adding it manually helped! Thanks so much, @AnotherDaniel!

superurban commented 1 year ago

ah, that was too quick. The only difference I can spot is "ha-mqtt-discoverable" vs "ha_mqtt_discoverable"


root@sma:~# cd smahub
root@sma:~/smahub# python3 -m venv .venv
root@sma:~/smahub# source .venv/bin/activate
(.venv) root@sma:~/smahub# pip3 install ha-mqtt-discoverable
Collecting ha-mqtt-discoverable
  Using cached ha_mqtt_discoverable-0.4.2-py3-none-any.whl (21 kB)
Collecting thelogrus<0.8.0,>=0.7.0
  Using cached thelogrus-0.7.0-py3-none-any.whl (14 kB)
Collecting gitlike-commands<0.3.0,>=0.2.1
  Using cached gitlike_commands-0.2.1-py3-none-any.whl (7.4 kB)
Collecting paho-mqtt<2.0.0,>=1.6.1
  Using cached paho_mqtt-1.6.1-py3-none-any.whl
Collecting pyaml<22.0.0,>=21.10.1
  Using cached pyaml-21.10.1-py2.py3-none-any.whl (24 kB)
Collecting PyYAML
  Using cached PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB)
Collecting dateutils<0.7.0,>=0.6.12
  Using cached dateutils-0.6.12-py2.py3-none-any.whl (5.7 kB)
Collecting python-dateutil
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytz
  Using cached pytz-2023.3-py2.py3-none-any.whl (502 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, PyYAML, pytz, python-dateutil, pyaml, dateutils, thelogrus, paho-mqtt, gitlike-commands, ha-mqtt-discoverable
Successfully installed PyYAML-6.0.1 dateutils-0.6.12 gitlike-commands-0.2.1 ha-mqtt-discoverable-0.4.2 paho-mqtt-1.6.1 pyaml-21.10.1 python-dateutil-2.8.2 pytz-2023.3 six-1.16.0 thelogrus-0.7.0
(.venv) root@sma:~/smahub# pip3 install .
Processing /root/smahub
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting debugpy~=1.6
  Using cached debugpy-1.6.7.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
ERROR: Could not find a version that satisfies the requirement ha_mqtt_discoverable~=0.9 (from smahub)
ERROR: No matching distribution found for ha_mqtt_discoverable~=0.9
AnotherDaniel commented 1 year ago

For some reason, you have a 0.4.2 installed/cached, and your system doesn't want to get the current version... what system are you on, there? I suggest prodding the pip cache a bit, like here: https://stackoverflow.com/questions/9510474/pip-uses-incorrect-cached-package-version-instead-of-the-user-specified-version#9510610

superurban commented 1 year ago

I started over with a fresh container - et voila, it's working! Thanks again for your support.

AnotherDaniel commented 1 year ago

Good to hear you solved it! - wouldn't really have known what was going on there ;-)