Using the python module pulp

Hi all,
first, thank you very much for developing the AppDaemon Addon. It’s great!
Now to my problem:
I already posted this question in the PyScript community, since I tried my python code first with PyScript und then with AppDaemon, however both show the same error.
This is related to the (unsolved) issue
https://community.home-assistant.io/t/how-to-install-pulp-package-on-appdaemon/841388.

I am trying to use the python module pulp. Thus I configured AppDaemon to install it.
However, when I try to solve a linear programming problem with the pulp routine solve, using the default solver PULP_CBC_CMD, pulp tries to execute the cbc solver in the backend, which is a command line executable usually shipped with the pulp module.
This throws the error

FileNotFoundError: [Errno 2] No such file or directory: ‘/usr/local/lib/python3.13/site-packages/pulp/apis/…/solverdir/cbc/linux/i64/cbc’

In the issue above, the conclusion was that cbc was not installed or missing, thus I checked that in the docker container and it turns out that the executable binary exists. However executing it directly on the command line throws a similar error:

bash: ./cbc: cannot execute: required file not found

I found this on stackoverflow which could mean that some system extention/interpreter is missing.

It seems, that the problem lies in the docker container being based on alpine linux as is hinted by this issue: https_://github.com/coin-or/Cbc/issues/551. (remove underscores, as a new user I am only allowed to place two hyperlinks -.- )

Is there any method of installing the coin-or solver correctly during startup of the AppDaemon? Currently it is only possible to install apk packages, but as discussed in the issue above, there is no app package for alpine. Any other idea?

Kind regards :slight_smile:

Hi,
i experienced a similar problem a few months ago. I couldn’t dive as deep as you did, for (1) a lack of sufficient knowledge, and (2) working on a virtual machine on a synology NAS. I installed a preconfigured package.
That said - i experienced the same. I circumvented the issue by installing another python module instead of pulp. That was possible. Would that be a solution for you too?

Hi, thanks for your answer. Yes, I have seen your problem description. Changing the python module is not really something I consider right now. What I tried so far was to use the Init commands of the AppDaemon configuration in order to compile and install the cbc solver during startup of the container. It turns out however, that this is not a trivial task and I was not successful on this one so far.
If this solution is not working, I will rather consider letting my python program run outside of home assistant and use the HA websocket API for data exchange between HA and my python program…