Tom-Hirschberger / MMM-CommandToNotification

A MagicMirror² module which peridocally calls configured scripts and sends the output as notification
MIT License
4 stars 1 forks source link

HTU21D failure #11

Open BKeyport opened 1 month ago

BKeyport commented 1 month ago

It appears your directions to install the HTU21 is out of date. (https://github.com/Tom-Hirschberger/MMM-CommandToNotification/blob/main/scripts/README.md#temperaturehtu21)

Your instructions fail here:

sudo pip3 install .
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Adafruit hasn't updated that module in years at this point.

Rather, they've gone to https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity-sensor/python-circuitpython

Maybe it's time to update your scripts to adjust?

Tom-Hirschberger commented 1 month ago

Hi,

as there had been a lot of problems between user installed libs and the system installed python libraries it is not supported to install Python libs system wide anymore (there is a force option but it might be a bad idea to use it. The easiest way will be to setup a Python virtual environment for my module an run the scripts within this venv. Even if I switch to CircuitPython Libs this step will be necessary. I will try to write a wrapper which can be used to call the scripts. The wrapper then can activate the venv before the call of the real script. If there is time left I will take a look at CircuitPython. As the protocol of the sensors did not change there is no real need to update the libs.

Tom-Hirschberger commented 3 weeks ago

Hi,

i released version 0.0.8 of the module a couple of minutes ago which now contains a wrapper to call the python scripts in a virtual environment. The Readme in the scripts folder contains updated instructions of how to use the script.

Please give me feedback if it is working for you.

Edit: As it only was a little more work I changed the Htu21 script to use the circuitpython Lib instead of the old one