continuing development on modules after they're installed
Ian
ian.g.kelly at gmail.com
Fri Dec 10 12:32:05 EST 2010
On Dec 10, 9:57 am, hoesley <hoes... at gmail.com> wrote:
> I just started using distutils to install the modules I'm working on
> to site-packages. Now, however, if I make changes in my development
> directory, then import the modules into python, it always loads up the
> installed version. Thus, I can't continue development without first
> uninstalling the modules I'm working on, so that the interpreter finds
> them in the local directory instead of site-packages. Is there any
> simple way around this? I figure this must be a very common thing to
> encounter. Thanks!
Do you need the installed version to be distinct from the development
version? If not, you can "install" the module using a simple soft
link (on Unix) or a .pth file (on Windows) that points to your
development directory.
If you do need them to be distinct, a simple way to preferentially get
the development version is to add it to the *beginning* of sys.path:
sys.path.insert(0, '/path/to/development/directory/')
This process can be simplified further by putting it in a
PYTHONSTARTUP script.
HTH,
Ian
More information about the Python-list
mailing list