【问题标题】:ModuleNotFoundError: No module named 'encodings' in Django on NGINX / uWSGIModuleNotFoundError:在 NGINX / uWSGI 上的 Django 中没有名为“编码”的模块
【发布时间】:2019-06-26 15:39:43
【问题描述】:

在 Ubuntu 16.04 / NGINX / uWSGI / Python 3.6 上运行的 Django 2.2

我不断得到: ModuleNotFoundError: No module named 'encodings' 在尝试 reload uWSGI 时出现在 uWSGI 错误日志中。此外,uWSGI 将在没有错误消息的情况下重新启动,但不会reload。然而,即使它restarts,问题应用程序也没有启动。

uWSGI配置文件:

[uwsgi]
chdir = /var/sites/mysite
module = mysite.wsgi
virtualenv = /opt/virtualenvs/mysite_venv
processes = 5
vacuum = True

【问题讨论】:

    标签: python django nginx uwsgi


    【解决方案1】:

    我在 uWSGI 错误日志中注意到 Python 3.5 在设置虚拟环境之前被调用。我用 uWSGI 配置文件中的以下几行解决了这个问题。

    plugins-dir = /usr/lib/uwsgi/plugins/
    plugin = python36
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-08
      • 2021-08-06
      • 2013-10-22
      • 2018-03-08
      • 2018-05-09
      相关资源
      最近更新 更多