Problem: Python search path - module order

A

aznach

Hello!

I have a shared hosting account at GrokThis.net and have a problem with
the module order of the Python search path.

I'd like to use django's svn trunk instead of the
"Django-0.95-py2.4.egg" provided in site-packages.

The problem is that the "django egg" gets preference over the "django
svn trunk" module I manually added to PYTHONPATH...

Instead of being prepended to the top of sys.path, the "django svn
trunk" module gets inserted AFTER the eggs that are in
"/usr/lib/python2.4/site-packages".

I use ~/.bash_profile to set:
----------------------------------------------------------------
export PYTHONPATH="$HOME/local/lib/python:$HOME/django_src"
----------------------------------------------------------------

where "django_src" is the location of django's svn trunk directory

sys.path contains:

----------------------------------------------------------------
/usr/lib/python2.4/site-packages/flup-0.5-py2.4.egg
/usr/lib/python2.4/site-packages/setuptools-0.6c1-py2.4.egg
/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg
/usr/lib/python2.4/site-packages/Myghty-1.0.2-py2.4.egg
/usr/lib/python2.4/site-packages/PasteScript-0.9.7-py2.4.egg
/usr/lib/python2.4/site-packages/PasteDeploy-0.9.6-py2.4.egg
/usr/lib/python2.4/site-packages/Paste-0.9.7-py2.4.egg
/usr/lib/python2.4/site-packages/Routes-1.4-py2.4.egg
/usr/lib/python2.4/site-packages/Cheetah-1.0-py2.4-linux-x86_64.egg
/home/shared/username/local/lib/python
/home/shared/username/django_src
/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/local/lib/python2.4/site-packages
/usr/lib/python2.4/site-packages
/usr/lib/python2.4/site-packages/PIL
----------------------------------------------------------------


importing django form the Python console renders:
--------------------------------------------------------------------------------------------------------------------------------

Is there a way to give the "django svn trunk" module preference over
the "django egg" (i.e. to have the "django svn trunk" inserted BEFORE
the eggs listed)??

Does anyone know a solution to this problem? Any help would be greatly
appreciated!

Best regards,
Aznach
 
T

Thomas Guettler

aznach said:
Hello!

I have a shared hosting account at GrokThis.net and have a problem with
the module order of the Python search path.

I'd like to use django's svn trunk instead of the
"Django-0.95-py2.4.egg" provided in site-packages.
I use ~/.bash_profile to set:

you can use sys.path.insert(0, ...) in the python code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top