473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem: Python search path - module order

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:
----------------------------------------------------------------
>>import django
django.VERSION
(0, 95, 'post-magic-removal')
>>>
----------------------------------------------------------------

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

Oct 16 '06 #1
1 1539
aznach wrote:
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:
----------------------------------------------------------------
export PYTHONPATH="$HOME/local/lib/python:$HOME/django_src"
----------------------------------------------------------------
you can use sys.path.insert(0, ...) in the python code.

--
Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: ni**************@thomas-guettler.de

Oct 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rene Olsthoorn | last post by:
Dear readers, py2exe has a problem including libxml2. Not at building time, but at runtime. The libxml2.dll cannot be loaded... Is there anyone that NOT has the problem? (and can you drop me...
3
by: Stephen Ferg | last post by:
I need a little help here. I'm developing some introductory material on Python for non-programmers. The first draft includes this statement. Is this correct? ...
7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
12
by: Richard Hanson | last post by:
Over the last few days, I reinstalled Win2kSP2 to a spare harddrive I had just swapped into my Fujitsu LifeBook P1120 (long story <wink>). Subsequently, I DL'ed the newest Python alpha (2.4a2), and...
10
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
6
by: Laszlo Zsolt Nagy | last post by:
Sorry, I realized that the import zlib was not executed from my (working) service. So here is the question: why can't I use zlib from a win32 service? Is there any way to make it working? ...
14
by: rurpy | last post by:
Another Python docs problem... I was trying to use imp.find_module(). >>> imp.find_module("mymod", "./subdir") ImportError: No frozen submodule named ./subdir.mymod subdir/mymod.py...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 349 open ( +7) / 3737 closed (+25) / 4086 total (+32) Bugs : 939 open (-12) / 6648 closed (+60) / 7587 total (+48) RFE : 249 open...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.