I am opening this issue for the sake of sharing a solution to a problem i have encountered with ail framework (5.2).
When using LAUNCH.sh -l, everything start normally except the flask server.
After investigating, it turns out that libretranslatepy/api.py is the problem, returning the following error when starting Flask_server.py in standalone:
(AILENV) ➜ www git:(master) python Flask_server.py
VT submission is disabled
Traceback (most recent call last):
File "Flask_server.py", line 36, in <module>
from blueprints.crawler_splash import crawler_splash
File "/home/user/Documents/ail-framework/var/www/blueprints/crawler_splash.py", line 28, in <module>
from lib import crawlers
File "/home/user/Documents/ail-framework/bin/lib/crawlers.py", line 41, in <module>
from lib.objects.Domains import Domain
File "/home/user/Documents/ail-framework/bin/lib/objects/Domains.py", line 21, in <module>
from lib.objects.abstract_object import AbstractObject
File "/home/user/Documents/ail-framework/bin/lib/objects/abstract_object.py", line 28, in <module>
from lib.Language import get_obj_languages, add_obj_language, remove_obj_language, detect_obj_language, get_obj_language_stats, get_obj_translation, set_obj_translation, delete_obj_translation
File "/home/user/Documents/ail-framework/bin/lib/Language.py", line 11, in <module>
from libretranslatepy import LibreTranslateAPI
File "/home/user/Documents/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/__init__.py", line 1, in <module>
from libretranslatepy.api import *
File "/home/user/Documents/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py", line 8, in <module>
class LibreTranslateAPI:
File "/home/user/Documents/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py", line 28, in LibreTranslateAPI
def __init__(self, url: str | None = None, api_key: str | None = None):
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
For fixing, just add on the first line of the file ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py : from __future__ import annotations.
Host : Ubuntu 20.04.6 AIL Framework version : 5.2
Hello,
I am opening this issue for the sake of sharing a solution to a problem i have encountered with ail framework (5.2).
When using
LAUNCH.sh -l
, everything start normally except the flask server.After investigating, it turns out that
libretranslatepy/api.py
is the problem, returning the following error when startingFlask_server.py
in standalone:For fixing, just add on the first line of the file
ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py
:from __future__ import annotations
.And restart the AIL
LAUNCH.sh -r