我不断收到:ModuleNotFoundError:尝试添加新配置时,单元错误日志中没有名为“encodings”的模块。
致命的 Python 错误:Py_Initialize:无法获取语言环境编码
ModuleNotFoundError:没有名为“编码”的模块
2020/12/31 19:51:50 [notice] 13294#13294 process 13297 exited with code 0
2020/12/31 19:51:50 [info] 15500#15500 discovery started
2020/12/31 19:51:50 [notice] 15500#15500 module: java 11.0.8 "/usr/lib/unit/modules/java11.unit.so"
2020/12/31 19:51:50 [notice] 15500#15500 module: perl 5.26.1 "/usr/lib/unit/modules/perl.unit.so"
2020/12/31 19:51:50 [notice] 15500#15500 module: php 7.2.24-0ubuntu0.18.04.6 "/usr/lib/unit/modules/php.unit.so"
2020/12/31 19:51:50 [notice] 15500#15500 module: python 2.7.17 "/usr/lib/unit/modules/python2.7.unit.so"
2020/12/31 19:51:50 [notice] 15500#15500 module: python 3.6.9 "/usr/lib/unit/modules/python3.6.unit.so"
2020/12/31 19:51:50 [notice] 15500#15500 module: python 3.7.5 "/usr/lib/unit/modules/python3.7.unit.so"
2020/12/31 19:51:50 [notice] 15500#15500 module: ruby 2.5.1 "/usr/lib/unit/modules/ruby.unit.so"
2020/12/31 19:51:50 [info] 15499#15499 controller started
2020/12/31 19:51:50 [notice] 15499#15499 process 15500 exited with code 0
2020/12/31 19:51:50 [info] 15514#15514 router started
2020/12/31 19:51:50 [info] 15514#15514 OpenSSL 1.1.1 11 Sep 2018, 1010100f
2020/12/31 19:52:40 [info] 15597#15597 "example_python" application started
2020/12/31 19:52:40 [info] 15602#15602 "example_python" application started
2020/12/31 19:54:20 [info] 15766#15766 "example_python" application started
2020/12/31 19:54:20 [info] 15767#15767 "example_python" application started
2020/12/31 19:54:20 [notice] 15499#15499 process 15597 exited with code 0
2020/12/31 19:54:20 [notice] 15499#15499 process 15602 exited with code 0
2020/12/31 19:57:49 [info] 16117#16117 "django" application started
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007f64d9a9ad80 (most recent call first):
2020/12/31 19:57:49 [alert] 15499#15499 process 16117 exited on signal 6 (core dumped)
2020/12/31 19:57:49 [warn] 15514#15514 failed to start application "django"
2020/12/31 19:57:49 [alert] 15514#15514 failed to apply new conf
sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/control.unit.sock http://localhost/config
单元配置
"applications": {
"django": {
"type": "python 3.7",
"user": "deepak",
"group": "deepak",
"path": "/home/deepak/PycharmProjects/project/venv",
"home": "/home/deepak/PycharmProjects/project",
"module": "wsgi",
"environment": {
"DJANGO_SETTINGS_MODULE": "project.settings",
"DB_ENGINE": "django.db.backends.postgresql",
"DB_NAME": "project",
"DB_HOST": "127.0.0.1",
"DB_PORT": "5434"
}
}
},
"listeners": {
"*:8400": {
"pass": "applications/django"
}
}
}```