On Dec 20, 7:19 am, Nabuco <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm pretty new to Python so the answer to my problem may be obvious,
> but I can't get to this folks.
>
> After installing python2.5 from sources, I switched the symlink in /
> usr/bin/python to point to /usr/local/bin/python. When I run a python
> shell, everything is OK (it tells I'm on python2.5.1).
>
> I migrated a Django project from a machine running python2.5 to a new
> one with python2.4 and now I get an error because I'm using code from
> python2.5 syntax not implemented in 2.4. The user-friendly error page
> shows a weird message for me:
>
> Request Method:         GET
> Request URL:    http://ftpadmin.azalorea.com/gallery/
> Exception Type:         AttributeError
> Exception Value:        'unicode' object has no attribute 'partition'
> Exception Location:     /aplicaciones/nabuco/ftpadmin/gallery/views.py in
> index, line 20
> Python Executable:      /usr/local/bin/python
> Python Version:         2.4.3
> Python Path:    ['/aplicaciones/nabuco/', '/usr/lib/python2.4/site-
> packages/setuptools-0.6c5-py2.4.egg', '/usr/lib/python2.4/site-
> packages/MySQL_python-1.2.2-py2.4-linux-i686.egg', '/usr/lib/
> python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2',
> '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/
> lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/PIL',
> '/usr/lib/python2.4/site-packages/gtk-2.0']
>
> So it tells that Python Executable is located at /usr/local/bin/python
> (which is python2.5) but Python Version is 2.4.3 and so are the paths
> in the Python Path...
>
> I am using Apache2 withmod_python, so I first thoughmod_python
> should need to becompiled and reinstalled and so I did. But no.
>
> I also svn checked out another copy of Django trunk and set it at /usr/
> local/lib/python2.5/site-packages/ and even moved the 'django' symlink
> at the old Django copy at /usr/lib/python2.4/site-packages/ to point
> to the new copy. But no.
>
> What am I missing?

Did you use the --with-python option to configure script for
mod_python when recompiling it?

Did you ensure you did a full 'stop' of Apache and not just a
'restart' after having installed new mod_python.so?

Is the mod_python.so using Python as a shared library or a static
library? Run 'ldd' on mod_python.so to work out if using shared
library.

Since you have Python 2.5 installed in non standard place, did you
modify 'envvars' file in same directory as Apache executable and set
PATH in it so that Apache would find 'python' in /usr/local/bin before
that in /usr/bin?

Did you check the Apache error logs to see what messages mod_python
output about version being used or warnings about version mismatches?

FWIW, you may want to swap to using mod_wsgi instead. At least it
documents these sorts of issues properly whereas it isn't documented
anywhere for mod_python. For mod_wsgi documentation related to same
problems see:

  http://code.google.com/p/modwsgi/wiki/InstallationIssues

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to