Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Start Flask Server #233

Open
fl0w2null opened this issue Aug 14, 2024 · 3 comments
Open

Can't Start Flask Server #233

fl0w2null opened this issue Aug 14, 2024 · 3 comments

Comments

@fl0w2null
Copy link

I got this error when trying to launch AIL
Anyone have had experience with this? Please let me know

Traceback (most recent call last):
  File "./Flask_server.py", line 36, in <module>
    from blueprints.crawler_splash import crawler_splash
  File "/root/ail-framework/var/www/blueprints/crawler_splash.py", line 28, in <module>
    from lib import crawlers
  File "/root/ail-framework/bin/lib/crawlers.py", line 41, in <module>
    from lib.objects.Domains import Domain
  File "/root/ail-framework/bin/lib/objects/Domains.py", line 21, in <module>
    from lib.objects.abstract_object import AbstractObject
  File "/root/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, get_obj_main_language
  File "/root/ail-framework/bin/lib/Language.py", line 11, in <module>
    from libretranslatepy import LibreTranslateAPI
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/__init__.py", line 1, in <module>
    from libretranslatepy.api import *
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py", line 7, in <module>
    class LibreTranslateAPI:
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py", line 27, in LibreTranslateAPI
    def __init__(self, url: str | None = None, api_key: str | None = None):
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType
'```
@fl0w2null
Copy link
Author

This problem was caused by python3.8, which is a little different in syntax when parameters weren't provided by default.
For exp:
def __init__(self, url: str | None = None, api_key: str | None = None) it should be def __init__(self, url=None, api_key= None)

@Terrtia
Copy link
Member

Terrtia commented Aug 14, 2024

Hi @fl0w2null !
Thanks for the report !
Did you patch libretranslatepy ?

@fl0w2null
Copy link
Author

Hi @fl0w2null ! Thanks for the report ! Did you patch libretranslatepy ?

I did, but changing it in small steps doesn't make sense, cause in some cases, I still see other error logs in modules.log and sync.log. I think you guys should change the requirements in the Installing guide, make sure to have Ubuntu version, Python version also...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants