При запуске Flask через Apache не видит paramiko
Мое приложение скачивает файлы по SSH. Если запускать Flask server через PyCharm, то всё ок. Он видит библиотеку paramiko и ее внутренние либы. Но если запустить через Appache, то выдает ошибку
PROG - папка с проектом
Мой wsgi.py:
import sys
# add rtdm project path into the sys.path
sys.path.append('D:\\Programs\\Apache24\\www\\PROG')
# add the virtualenv site-packages path to the sys.path
sys.path.append('D:\\Programs\\Apache24\\www\\PROG\\venv\\Lib\\site-packages')
from main import app as application
if __name__ == "__main__":
application.run(host='127.0.0.1', port=8000)
Ошибка:
mod_wsgi (pid=43532): Failed to exec Python script file 'D:/Programs/Apache24/www/PROG/wsgi.py'.
[Thu Nov 12 17:52:07.047781 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] mod_wsgi (pid=43532): Exception occurred processing WSGI script 'D:/Programs/Apache24/www/PROG/wsgi.py'.
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] Traceback (most recent call last):\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:\\Programs\\Apache24\\www\\PROG\\venv\\Lib\\site-packages\\paramiko\\ssh_gss.py", line 53, in <module>\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] import gssapi\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] ModuleNotFoundError: No module named 'gssapi'\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] \r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] During handling of the above exception, another exception occurred:\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] \r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] Traceback (most recent call last):\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:/Programs/Apache24/www/PROG/wsgi.py", line 10, in <module>\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] from main import app as application\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:\\Programs\\Apache24\\www\\PROG\\main.py", line 7, in <module>\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] from . import ssh_helper\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:\\Programs\\Apache24\\www\\PROG\\src\\ssh_helper.py", line 1, in <module>\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] import paramiko\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:\\Programs\\Apache24\\www\\PROG\\venv\\Lib\\site-packages\\paramiko\\__init__.py", line 22, in <module>\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] from paramiko.transport import SecurityOptions, Transport\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:\\Programs\\Apache24\\www\\PROG\\venv\\Lib\\site-packages\\paramiko\\transport.py", line 38, in <module>\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] from paramiko.auth_handler import AuthHandler\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:\\Programs\\Apache24\\www\\PROG\\venv\\Lib\\site-packages\\paramiko\\auth_handler.py", line 72, in <module>\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] from paramiko.ssh_gss import GSSAuth, GSS_EXCEPTIONS\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:\\Programs\\Apache24\\www\\PROG\\venv\\Lib\\site-packages\\paramiko\\ssh_gss.py", line 58, in <module>\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] import pywintypes\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:\\Programs\\Python37\\lib\\site-packages\\win32\\lib\\pywintypes.py", line 136, in <module>\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] __import_pywin32_system_module__("pywintypes", globals())\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] File "D:\\Programs\\Python37\\lib\\site-packages\\win32\\lib\\pywintypes.py", line 129, in __import_pywin32_system_module__\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] assert sys.modules[modname] is not old_mod\r
[Thu Nov 12 17:52:07.063400 2020] [wsgi:error] [pid 43532:tid 1148] [client ::1:63400] AssertionError\r