Richard Chapman - 2008-06-19

I have a Centos 5.1 X86_64 system which seems to come with MySQL-python 1.2.1-1
I have been trying to install a python package called surftrackr - and it gives me the following message when I go to open its website:
ImproperlyConfigured: Error importing middleware django.contrib.sessions.middleware: "MySQLdb-1.2.1p2 or newer is required; you have 1.2.1"

I believe this means I need to upgrade to a newer version of MySQL-python. I have followed the instructions in the release notes for version 1.2.2 - and it seems to go through fine. Here are the last few lines of the install process:

Removing /usr/lib64/python2.4/site-packages/MySQL_python-1.2.2-py2.4-linux-x86_64.egg
Copying MySQL_python-1.2.2-py2.4-linux-x86_64.egg to /usr/lib64/python2.4/site-packages
MySQL-python 1.2.2 is already the active version in easy-install.pth

Installed /usr/lib64/python2.4/site-packages/MySQL_python-1.2.2-py2.4-linux-x86_64.egg
Processing dependencies for MySQL-python==1.2.2
Finished processing dependencies for MySQL-python==1.2.2
[root@C5 MySQL-python-1.2.2]#


After restarting Apache - I now have a slightly different problem and this is my current error:

[Errno 13] Permission denied: '/root/.python-eggs'

The Python egg cache directory is currently set to:

/root/.python-eggs

Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.


I am not sure how and where to define an environment variable for the apache server - so I tried to create this directory and set its permissions - this:
drwxrwxrwx 2 apache apache 4096 Jun 18 23:57 .python-eggs

But I still get the error.

1) Can anyone nexplain why I still get the error - in spite of the permissions abone.
2) How do I set an environment variable for the apache server/user.

Thanks.

Richard.