1

I am getting this in my error log file. Ive been searching for asolution but have found nothing. I am trying to deploy django with mod_wsgi.

[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
4
  • 1
    This would suggest you've installed a 64-bit python interpreter but kept the 32-bit _functools.so somehow. Commented Jun 13, 2012 at 16:30
  • Im using a shared library with a parallel python 2.6 installation with python 2.4 Commented Jun 13, 2012 at 16:35
  • Trying to get Python 2.4 to use Python 2.6's standard library by messing with the PYTHONPATH seems like recipe for disaster even if they're both 32-bit or 64-bit; you're probably quite likely to see syntax errors as well. Commented Jun 13, 2012 at 16:49
  • both python installations are 64bit. What PYTHONPATH would i add to my .bash_profile Commented Jun 13, 2012 at 16:55

1 Answer 1

3

You have the wrong version of the functional module installed. Either install the correct binary version, or use the pure-python version.

Sign up to request clarification or add additional context in comments.

3 Comments

how would I go about doing this?
can I just swap out _functools.so with the correct one in /usr/lib/python2.6/lib-dynload or would this break python?
@user1442957 You can try it, but I can't guarantee you won't see problems at some point. It would be much better to install a version compatible with your installation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.