Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6054163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:07:20+00:00 2026-05-23T08:07:20+00:00

I have such cfg on my amd64 platform with ubuntu 11.04: build python2.5 from

  • 0

I have such cfg on my amd64 platform with ubuntu 11.04:

  1. build python2.5 from source to /usr/local/python2.5
  2. virtualenv at /home/se7en/.virtualenvs/e-py25

alsp i recompile mod_wsgi.so to custom python:

se7en@se7en-System-Product-Name:~$ ldd /usr/lib/apache2/modules/mod_wsgi.so
    linux-vdso.so.1 =>  (0x00007fff5af6c000)
    libpython2.5.so.1.0 => /usr/lib/libpython2.5.so.1.0 (0x00007f7bed14b000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7becf2d000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7becd28000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f7becb25000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7bec8a0000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7bec50b000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f7bed717000)

django.wsgi

#/usr/local/python2.5/bin/python
# -*- coding: utf-8 -*-
import os, sys
sys.stdout = sys.stderr


dn = os.path.dirname
PROJECT_ROOT = os.path.abspath( (dn(__file__)) )

#DJANGO_PROJECT_ROOT = os.path.join(PROJECT_ROOT, 'apps')
DJANGO_PROJECT_ROOT = PROJECT_ROOT

sys.path.insert(0, '/usr/local/python2.5/lib/python2.5/site-packages' )
sys.path.insert(0,'/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages')
sys.path.insert(0, DJANGO_PROJECT_ROOT )


os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

print sys.version #return 2.5.5 (r255:77872, Apr 15 2011, 22:12:51
print sys.path

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

apache site config:

<VirtualHost 192.168.1.3>

    ServerAdmin admin@wsgi.debianworld.ru
    ServerName wsgi.debianworld.ru


    ErrorLog    /home/se7en/workspace/lxchg/logs/error_log
    CustomLog   /home/se7en/workspace/lxchg/logs/access_log common



    WSGIScriptAlias / /home/se7en/workspace/lxchg/django.wsgi






    Alias "/media/" "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/contrib/admin/media/"
    <Location "/media/">
        SetHandler None
    </Location>

    Alias "/main_media/" "/home/se7en/workspace/lxchg/main_media/"
    <Location "/main_media/">
        SetHandler None
    </Location>
</VirtualHost>
WSGIPythonHome /home/se7en/.virtualenvs/e-py25
#WSGIPythonExecutable /usr/local/python2.5/bin/python

I got an error in my error log:

[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3] mod_wsgi (pid=2955): Exception occurred processing WSGI script '/home/se7en/workspace/lxchg/django.wsgi'.
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3] Traceback (most recent call last):
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 248, in __call__
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     response = self.get_response(request)
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/core/handlers/base.py", line 141, in get_response
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     return self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/core/handlers/base.py", line 176, in handle_uncaught_exception
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     if resolver.urlconf_module is None:
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/core/urlresolvers.py", line 239, in _get_urlconf_module
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     self._urlconf_module = import_module(self.urlconf_name)
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/utils/importlib.py", line 35, in import_module
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     __import__(name)
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "C:\\workspace\\sdl\\lxchg\\urls.py", line 3, in <module>
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/views/generic/create_update.py", line 1, in <module>
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     from django.forms.models import ModelFormMetaclass, ModelForm
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/forms/__init__.py", line 17, in <module>
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     from models import *
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/forms/models.py", line 6, in <module>
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     from django.db import connections
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/db/__init__.py", line 77, in <module>
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     connection = connections[DEFAULT_DB_ALIAS]
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/db/utils.py", line 92, in __getitem__
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     backend = load_backend(db['ENGINE'])
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]   File "/home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/django/db/utils.py", line 50, in load_backend
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     raise ImproperlyConfigured(error_msg)
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3] ImproperlyConfigured: 'django.db.backends.mysql' isn't an available database backend. 
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3] Try using django.db.backends.XXX, where XXX is one of:
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3]     'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3'
[Wed Jun 22 13:45:54 2011] [error] [client 192.168.1.3] Error was: /home/se7en/.virtualenvs/e-py25/lib/python2.5/lib-dynload/array.so: undefined symbol: PyUnicodeUCS2_FromUnicode

Then i start project via manage.py runserver it works, but via mod_wsgi do not.
please help)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:07:20+00:00Added an answer on May 23, 2026 at 8:07 am

    The operating system supplied Python versions on Linux boxes are compiled for UCS4 Unicode character width. If you build from source code, if you don’t explicitly say otherwise it will default to UCS2. The result is that your system Python 2.5 and local version under /usr/local are expecting different widths for Unicode characters and since Unicode functions have the UCS type as part of the name, when you are using objects compiled for one Python with the other, you get undefined errors for the Unicode functions.

    Why this is occuring as hinted at by other answer is that mod_wsgi.so is actually picking up the system wide UCS4 libpython2.5.so file instead of that for UCS2 Python under /usr/local/lib. Although you could set LD_LIBRARY_PATH to make a process to look in /usr/local/lib first, that is a pain to do under Apache. Instead what you should do is rebuild mod_wsgi from source code again and do:

    make distclean
    ./configure --with-python=/usr/local/bin/python2.5
    LD_RUN_PATH=/usr/local/lib make
    sudo make install
    

    By setting LD_RUN_PATH as environment variable on the command when invoking ‘make’, the linker will embed /usr/local/lib into library search path direct into mod_wsgi.so. That way it will find correct libpython2.5.so at run time without needing to set LD_LIBRARY_PATH. You can confirm it worked by running ‘ldd’ on the resultant mod_wsgi.so and it should then pick up correct library from /usr/local/lib.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In ejabberd.cfg I have the following {host_config, thisislove-MacBook-2.local, [{auth_method, [internal, anonymous]}, {allow_multiple_connections, false}, {anonymous_protocol,
I have such script: (Script.pl) #!/usr/bin/perl use strict; use warnings; use encoding 'utf-8'; use
I have such files to parse (from scrapping) with Python: some HTML and JS
I have such GUI situation: Window1>vbox1>vbox2>scrolledvindow1>treeview1>treestore1. Program takes data from database through MySql C-api.
I have such part of code: var xhr = new XMLHttpRequest(); xhr.open(POST, http://someurl.com, true);
I have such template functions: template<class R> list<R> f(const boost::function<R()>&); template<class R, class A0>
I have such a code that tries to save some informations to database but
Have such script: #! /bin/bash typeset -i i END let END=500 i=1 remainder=1 accum=use
I have such design: public interface MyInterface { public abstract List<Sth> getSth(); } public
I have such an array for rendering TableGear : array( database => array( 'username'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.