【问题标题】:apache python error阿帕奇蟒错误
【发布时间】:2012-06-13 16:24:42
【问题描述】:

我在我的错误日志文件中得到了这个。我一直在寻找解决方案,但一无所获。我正在尝试使用 mod_wsgi 部署 django。

[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117] ImportError: /usr/lib/python2.6/lib-dynload/_functools.so: wrong ELF class: ELFCLASS32
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117] mod_wsgi (pid=20219): Target WSGI script '/home/dbs/public_html/test.wsgi' cannot be loaded as Python module.
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117] mod_wsgi (pid=20219): Exception occurred processing WSGI script '/home/dbs/public_html/test.wsgi'.
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117] Traceback (most recent call last):
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117]   File "/home/dbs/public_html/test.wsgi", line 6, in <module>
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117]     import django.core.handlers.wsgi
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117]   File "/home/dbs/sites/domain.com/django/core/handlers/wsgi.py", line 2, in <module>
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117]     from threading import Lock
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117]   File "/usr/lib/python2.6/threading.py", line 13, in <module>
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117]     from functools import wraps
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117]   File "/usr/lib/python2.6/functools.py", line 10, in <module>
[Wed Jun 13 12:15:53 2012] [error] [client 207.46.13.117]     from _functools import partial, reduce

【问题讨论】:

  • 这表明你已经安装了一个 64 位的 Python 解释器,但不知何故保留了 32 位的 _functools.so。
  • 我使用共享库和 python 2.4 并行安装 python 2.6
  • 试图通过弄乱 PYTHONPATH 来让 Python 2.4 使用 Python 2.6 的标准库似乎是灾难的秘诀,即使它们都是 32 位或 64 位;您也很可能会看到语法错误。
  • 两个 python 安装都是 64 位的。我会将什么 PYTHONPATH 添加到我的 .bash_profile

标签: python django apache mod-wsgi wsgi


【解决方案1】:

您安装了错误版本的 functional 模块。要么安装正确的二进制版本,要么使用纯 python 版本。

【讨论】:

  • 我该怎么做呢?
  • 我可以将 _functools.so 换成 /usr/lib/python2.6/lib-dynload 中的正确的,否则会破坏 python?
  • @user1442957 你可以试试,但我不能保证你在某个时候不会看到问题。安装与您的安装兼容的版本会更好。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-10-15
  • 1970-01-01
  • 2012-05-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多