1

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

Oliver
  • 3,592
  • 8
  • 34
  • 37

2 Answers2

1

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

PYTHONPATH vs. sys.path

Community
  • 1
  • 1
Oliver
  • 3,592
  • 8
  • 34
  • 37
0

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

user261840
  • 168
  • 2
  • 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 sys print sys.path remain the same as if PYTHONPATH never take effect – Oliver Feb 23 '10 at 05:09