changing sys.path

John Nagle nagle at animats.com
Wed Feb 8 16:43:11 EST 2012


On 2/1/2012 8:15 AM, Andrea Crotti 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.

    Do

	import sys

first.

					John Nagle



More information about the Python-list mailing list