Habapp install doesn't install dependencies or create directories

Thanks, that worked. I needed to to that after activate. After that I had issue with OpenHAB login, but I found that I need to enable basic auth. Another issue was, that fronttail settings were not installed - I did it by hand and now I can see some logs.
Latest issue I have is with example rule. I can see in log that rule has been loaded, but I can’t see anything in log. If I understand correctly, there should be "that was easy!’ message somewhere.

2021-11-22 08:35:13.615 [INFO ] [HABApp.Rules                        ] - Added rule "MyFirstRule" from rules/MyFirstRule.py

I tried using logger as well, but also no luck.
My modified example looks like this:

import logging
import HABApp

log = logging.getLogger('MyRule')

# Rules are classes that inherit from HABApp.Rule
class MyFirstRule(HABApp.Rule):
    def __init__(self):
        super().__init__()

        # Use run.at to schedule things directly after instantiation,
        # don't do blocking things in __init__
        self.run.soon(self.say_something)

    def say_something(self):
        log.info('That was easy!')

# Rules
MyFirstRule()
log.info('Info Message')

Many thanks!
Marcin

You have to log to an existing logger and a logger ‘MyRule’ that does write to a file does not exist.
Use the logging.yml to add loggers and define their output files.

Ach, so obvious! :smiley: Thank you! Now all works. Just last question, what happens with print output?
In MyFirstRule example there is print. I assume that it should work too right? Is STD output handled somehow?

Cheers,
Marcin

If you start habapp by hand (e.g. from the console) the print will show in the console window.
If you start habapp as a service you can see the print in the status of the service or the journal.

Thanks!

Hi @Spaceman_Spiff
I have the same issue and none of the given answers seem to work.
I set up a new openhabian for testing on rPi 3B.
First I tried installing habapp from openhabian-config which seemed to work, the venv was created but starting resulted in ModuleNotFoundError: No module named ‘pydantic’
After that I installed habapp and all packages from the list manually (They all were missing), but still the same error when trying to run habapp.

BTW: What is the minimum Python version for habapp? My productive system runs on raspbian stretch (manual setup) that does not support python > 3.5. Do I need to set up a new system to use habapp?

Regards,
Martin

HABApp and its dependencies need at least python 3.7 to work properly.

You can always manually install a more recent python distribution.

Python 3.5 is the latest version in the repositories for raspbian stretch, so I tried compiling 3.7 but it always ended in errors, so I will probably set up a new productive system.

However this is not the reason for my problems, the test system has a recent python installed.

Today I tried again and it worked (after installing the dependencies manually).
Maybe my fault was to perform these steps inside the virtual environment, not outside:

Sorry to res an old post, but I’m having this same problem trying to install HABApp, except it’s with a package called “EasyCo”. I was able to manually install Pydantic, and got past that dependency (haven’t gotten to pendulum yet), but I’m stuck on trying to get it to recognize the install for EasyCo.

I’ve done both

sudo pip install EasyCo

and also

sudo pip3 install EasyCo

Both seem to work after updating pip (it says “requirement already satisfied”). But when I go back to running the HABApp installer

habapp --config /etc/openhab/habapp

I still get “ModuleNotFoundError: No module named ‘EasyCo’”.

If I try installing EasyCo with pip2, I get a syntax error. But I’m assuming that I shouldn’t want a python2 version of EasyCo. I should want the python3 version, right? How do I get past this?

Are you not installing in a venv like the docs suggest?
What version of HABApp are you trying to install?
The oldest version you sould be installing is 0.31.2

If you are running openhabian, there is now a menu option to install it from within openhabian-config

Are you not installing in a venv like the docs suggest?

Yes, I have treid to install inside a venv. I am following the steps of the installation guide at Installation & Usage — HABApp beta documentation.

What version of HABApp are you trying to install?

I’m not specifying a version, so I’m assuming that it’s installing the latest version.

If you are running openhabian, there is now a menu option to install it from within openhabian-config

Yes, I am running on OpenHABian (on a RPi 4). I did the initial installation through openhabian-config. And then I tried running HABApp using the commands from the installation guide linked above (to verify that everything was installed). As far as I can tell, HABApp installed correctly. The error occurs when trying to run it for the first time. I keep getting “No module named ‘EasyCo’”. I installed EasyCo using pip, and it seems to have successfully installed, because if I try to install it again, I am told “Requirement already satisfied”. But yet, when trying to run HABApp, I still get the “No module named ‘EasyCo’” error.

Is it possible that trying to install via openHABian-config and also going through the venv install process maybe created some kind of conflict? Should I un-install HABApp and then try again?

Well looks like I made it through. I un-installed HABApp using the openhabian-config console, then re-installed it. Now I am able to get through all the dependencies and launch HABApp. I’m not sure what I was doing wrong, but now it’s working for some reason.

I think there was a mix up with the virtual environments and / or you tried to use an old (now) unsupported python version. But I’m glad you got it working. Version 1.0.8?