Re: changing sys.path
- From: Tim Roberts <timr@xxxxxxxxx>
- Date: Thu, 02 Feb 2012 21:10:12 -0800
Andrea Crotti <andrea.crotti.0@xxxxxxxxx> wrote:
So suppose I want to modify the sys.path on the fly before running some code
which imports from one of the modules added.
at run time I do
sys.path.extend(paths_to_add)
but it still doesn't work and I get an import error.
Are you actually adding multiple paths? One possible cause for error would
be this:
sys.path.extend( '/usr/local/lib' )
That succeeds, but it doesn't do what you meant. It adds "/" as a path,
then "u", then "s", then "r", and so on.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- References:
- changing sys.path
- From: Andrea Crotti
- changing sys.path
- Prev by Date: Re: copy on write
- Next by Date: Re: Problem sending an email in html with mime image
- Previous by thread: Re: changing sys.path
- Next by thread: Re: changing sys.path
- Index(es):