views:

112

answers:

2

hi,

I inherited a python project, which has been packaged as egg. Upon check out through SVN, I am seeing package content as:

__init__.py
scripts/
ptools/
setup.py
...

Here, ptools/ hold the source of various modules. scripts/ is bunch of end-user tools that make use of modules provided by the "ptools". The package has been installed on this shared host environment through "easy_install", but I want to modify both scripts/ and ptools/ and test them out without having to go through the cycle of "make an egg, and easy_install" that will affect everyone else.

However, I am lost on how to make environment changes to make scripts/ not to search default .egg when invoking through my development tree, instead of using the "local" modules in ptools/ ... any ideas?

Update: I should have added that I tried PYTHONPATH approach by putting the module path in dev tree there, but then I tried verify through "import sys; print sys.path", there is no change in module search path, which baffles me.

thanks

Oliver

A: 

You can use the PYTHONPATH environment variable to customize the locations Python searches for modules.

I have tried this, but for some reason, it didn't work as I expected. For example:export PYTHONPATH="/path/to/svn/project"My understanding is, this path will be appended before sys.path. However, import sysprint sys.pathremain the same as if PYTHONPATH never take effect
Oliver
A: 

I think I have found the solution to my problem, and this has been answered in the following post. "setup.py develop" seems to be the perfect solution

http://stackoverflow.com/questions/1893598/pythonpath-vs-sys-path/1893622#1893622

Oliver