sys.path.insert - how to make it global?

Tim Peters tim_one at email.msn.com
Sat Apr 17 13:08:39 EDT 1999


[Stefan Franke]
> sys.path *is* already global, though only accessible via the
> sys module's namespace. Just give it a try.

[Randall Hopper]
> I'd already tried that.  It's effect doesn't appear to be global:
>
>    # Augment search path to pull in our C library wrappers
>    sys.path.insert( 0, '/home/mylogin/Wrappers' )
>
>    import MapFile
>
> This allows Python to find MapFile, but this doesn't allow MapFile to
> import other modules in that same Wrappers directory.

Randall, try posting a minimal set of failing code.  This works for everyone
else on the face of the earth, so the hope is that in trying to whittle your
code down you'll come face to face with the demon who's clouding your mind
<wink>.  If MapFile is C code, it's more likely that you're writing C-level
imports incorrectly.

debugging-as-exorcism-ly y'rs  - tim






More information about the Python-list mailing list