【问题标题】:keep getting the Fatal Python error with mod_wsgi and apache使用 mod_wsgi 和 apache 不断收到致命的 Python 错误
【发布时间】:2020-07-06 12:52:48
【问题描述】:
Current thread 0x00007f5aa48af880 (most recent call first):
no Python frame
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = /var/www/project/venu/bin/python
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = /var/www/project/venu/bin/python
  sys.base_prefix = '/opt/python3.8.2'
  sys.base_exec_prefix = '/opt/python3.8.2'
  sys.executable = '/var/www/project/venu/bin/python
  sys.prefix = '/opt/python3.8.2'
  sys.exec_prefix = '/opt/python3.8.2'
  sys.path = [
    '/opt/python3.8.2/lib/python38.zip',
    '/opt/python3.8.2/lib/python3.8',
    '/opt/python3.8.2/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named encodings

Current thread (most recent call first)

我已将 python 3.8.2 与 django 2.2 兼容。它在本地运行良好,但是当我尝试使用 Apache 和 mod_wsgi 4.7.1 部署它并出现上述错误时。有什么建议吗?

【问题讨论】:

  • 我也有同样的问题。我现在找不到 URL,但几周前,一位 Django 开发人员得出结论,这是由于 mod_wsgi 中的一个错误,他正在调查它。

标签: python django apache mod-wsgi


【解决方案1】:

在我的例子中,我的特定 LoadModule wsgi_module "/path_to_conda" 被忽略了,因为之前启用了 wsgi apache mod。我必须先用a2dismod wsgias answered here 禁用它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-01-30
    • 2016-02-01
    • 2018-07-28
    • 2011-09-24
    • 1970-01-01
    • 2013-07-04
    • 1970-01-01
    相关资源
    最近更新 更多