Target WSGI script cannot be loaded as Python module. AttributeError: module 'enum' has no attribute 'IntFlag'

Не могу развернуть сайт, подскажите пожалуйста что я делаю не так?

Файл event.wsgi

#!/usr/bin/python

import sys
sys.path.insert(0,"/var/www/event/")



from event import create_app
application = create_app()

Файл /etc/apache2/sites-available/event.conf

<VirtualHost touremanager.ru:80>
    ServerName touremanager.ru
    ServerAdmin [email protected]
    ErrorLog /var/www/event/logs/error.log
    CustomLog /var/www/event/logs/access.log combined
    WSGIDaemonProcess event user=www-data group=www-data threads=5 python-home=/var/www/event/venv
    WSGIScriptAlias / /var/www/event/event.wsgi

    <Directory /var/www/event/event/static>
        WSGIProcessGroup event
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

Лог ошибок

root@touremanager:/var/www/event/logs# cat error.log
[Mon Dec 07 17:57:06.147083 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418] mod_wsgi (pid=8267): Target WSGI script '/var/www/event/event.wsgi' cannot be loaded as Python module.
[Mon Dec 07 17:57:06.147162 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418] mod_wsgi (pid=8267): Exception occurred processing WSGI script '/var/www/event/event.wsgi'.
[Mon Dec 07 17:57:06.149112 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418] Traceback (most recent call last):
[Mon Dec 07 17:57:06.149169 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/event.wsgi", line 8, in <module>
[Mon Dec 07 17:57:06.149178 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     from event import create_app
[Mon Dec 07 17:57:06.149198 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/event/__init__.py", line 6, in <module>
[Mon Dec 07 17:57:06.149208 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     from flask_admin import Admin, AdminIndexView
[Mon Dec 07 17:57:06.149228 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/venv/lib/python3.7/site-packages/flask_admin/__init__.py", line 6, in <module>
[Mon Dec 07 17:57:06.149235 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     from .base import expose, expose_plugview, Admin, BaseView, AdminIndexView  # noqa: F401
[Mon Dec 07 17:57:06.149250 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/venv/lib/python3.7/site-packages/flask_admin/base.py", line 7, in <module>
[Mon Dec 07 17:57:06.149256 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     from flask_admin import babel
[Mon Dec 07 17:57:06.149266 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/venv/lib/python3.7/site-packages/flask_admin/babel.py", line 46, in <module>
[Mon Dec 07 17:57:06.149286 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     from wtforms.i18n import messages_path
[Mon Dec 07 17:57:06.149300 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/venv/lib/python3.7/site-packages/wtforms/__init__.py", line 11, in <module>
[Mon Dec 07 17:57:06.149307 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     from wtforms import validators, widgets
[Mon Dec 07 17:57:06.149319 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/venv/lib/python3.7/site-packages/wtforms/validators.py", line 9, in <module>
[Mon Dec 07 17:57:06.149326 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     import email_validator
[Mon Dec 07 17:57:06.149350 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/venv/lib/python3.7/site-packages/email_validator/__init__.py", line 6, in <module>
[Mon Dec 07 17:57:06.149356 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     import dns.resolver
[Mon Dec 07 17:57:06.149365 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/venv/lib/python3.7/site-packages/dns/resolver.py", line 32, in <module>
[Mon Dec 07 17:57:06.149371 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     import dns.flags
[Mon Dec 07 17:57:06.149380 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]   File "/var/www/event/venv/lib/python3.7/site-packages/dns/flags.py", line 24, in <module>
[Mon Dec 07 17:57:06.149385 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418]     class Flag(enum.IntFlag):
[Mon Dec 07 17:57:06.149411 2020] [wsgi:error] [pid 8267:tid 46962366015232] [client 62.76.160.2:47418] AttributeError: module 'enum' has no attribute 'IntFlag'
root@touremanager:/var/www/event/logs# 


Ответы (0 шт):