ImportError depending on the calling module

Samuel knipknap at gmail.com
Thu Sep 6 12:13:56 EDT 2007


On Sep 6, 5:44 pm, Gabriel Genellina <gagsl-... at yahoo.com.ar> wrote:
> On 6 sep, 08:47, Samuel <knipk... at gmail.com> wrote:
> > Given the following directory structure:
>
> > ---------
> > |-- Obj.py
> > |-- __init__.py
> > |-- foo
> > |   |-- FooTest.py
> > |   `-- __init__.py
> > `-- start1.py
> > ---------
>
> The container looks like a package (you didn't tell us the name).
> Should be placed somewhere accessible thru sys.path

But it is. I added the path to sys.path.

> They should import the package as any other
> client code, without doing any import tricks nor playing with
> sys.path.

Why does it matter whether I install it in sys.path or whether
sys.path is modified? What's the difference?

What I am doing is I ship two modules in one tarball with my software.
The software is only unpacked and ran. It has to work without
installation.

-Samuel




More information about the Python-list mailing list