Closed freffkg closed 3 years ago
Stick with what mlapi requires https://github.com/pliablepixels/mlapi/blob/master/requirements.txt
Thank you for pointing me in the right direction. pip kept installing version 4.0 even though I explicitly asked for version 3.25.0 I was able to get the right package installed with the following and things seems to be working well.
pip install --no-cache-dir --upgrade Flask-JWT-Extended==3.25.0
The right process is to actually use requirements.txt like so: sudo -H pip3 install -r requirements.txt
as described in the readme
yes I followed those instructions and used that command. It somehow gave me the 4.0 version which I had to fix.
I was running mlapi manually (not a system service) and having a problem with errors reported in zoneminder log. After some research I found someone with a similar problem found that there was some change to flask-jwt-extended version 4.0.0+? There was a recommendation to change @jwt_required to @jwt_required() https://github.com/vimalloc/flask-jwt-extended/issues/175
So I edited mlapi.py and changed class Detect(Resource): @jwt_required
to class Detect(Resource): @jwt_required()
at that point object detection started working great and I could see from the logs output to screen by mlapi that it was processing as expected. Happy days, I thought that I fixed the problem.
So I went ahead and tried to install mlapi as a service and unfortunately the service will not start with the @jwt_required()
So I next changed mlapi.py back to the original, without (). With the original mlapi.py it will start and run as a system service. However, unfortunately this puts me back in the starting condition where I get strange errors in zoneminder log such as shown below. Changing back to @jwt_required() and running manually, not as a system service works. Sorry I am not much of a python programmer so I don't really know what is going on or how to fix this. Any help getting to this work as a system service would be appreciated. The system service runs as www-data, when I run it with the extra () I use sudo and run it as root. So I don't know if maybe that has anything to do with it at all.