невозможно запустить uwsgi с ошибкой кодировки в uwsgi 2.0.18 и python 3.6.9 - PullRequest
0 голосов
/ 19 июня 2020

У меня серьезные проблемы с запуском uwsgi в проекте django с nginx. Я даже пытался запустить plugins=python36, но все равно не смог. Я проверил uWSGI Fails with No module named encoding Error , но мне это не помогает. Я до сих пор не знаю, как исправить ModuleNotFoundError: No module named 'encodings'. Не могли бы вы посоветовать и помочь мне? Спасибо !!

Вот информация о версиях:

  • Python 3.6.9
  • uwsgi 2.0.18
  • nginx версия: nginx / 1.14.0 (Ubuntu)
  • / usr / local / bin / uwsgi

Я получил следующую ошибку при запуске sudo uwsgi --ini /usr/share/nginx/html/portal/portal_uwsgi.ini

[uWSGI] getting INI configuration from /usr/share/nginx/html/portal/portal_uwsgi.ini
open("./python3_plugin.so"): No such file or directory [core/utils.c line 3724]
!!! UNABLE to load uWSGI plugin: ./python3_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.18 (64bit) on [Thu Jun 18 22:51:54 2020] ***
compiled with version: 7.5.0 on 11 June 2020 23:01:20
os: Linux-5.3.0-59-generic #53~18.04.1-Ubuntu SMP Thu Jun 4 14:58:26 UTC 2020
machine: x86_64
clock source: unix
detected number of CPU cores: 4
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
chdir() to /usr/share/nginx/html/portal
your processes number limit is 63773
your memory page size is 4096 bytes
 *** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /tmp/uwsgi.sock fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.6.9 (default, Apr 18 2020, 01:56:04)  [GCC 8.4.0]
Set PythonHome to /usr/share/nginx/html/portal
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f962e59e640 (most recent call first):
Aborted

Вот /usr/share/nginx/html/portal/portal_uwsgi.ini

[uwsgi]

# Django-related settings
# the base directory (full path)
chdir           = /usr/share/nginx/html/portal
# Django's wsgi file
module          = config.wsgi
# the virtualenv (full path)
home            = /usr/share/nginx/html/portal

# process-related settings
# master
master          = true
# maximum number of worker processes
processes       = 10
# the socket (use the full path to be safe
socket          = /tmp/uwsgi.sock
# ... with appropriate permissions - may be needed
chmod-socket    = 666
# clear environment on exit
vacuum          = true
# Reload worker to avoid memory leak
max-requests    = 5000
# Recycle worker if a request to it takes longer than specified seconds
harakiri        = 90

plugins = python3
...