python import error, what's wrong?

Ulrich Eckhardt ulrich.eckhardt at
Wed Aug 3 03:14:59 EDT 2011

smith jack wrote:
> I am using pydev plugin in eclipse, all things works just as well
> but now i have confronted with a confusing problem, that is i can
> import a module write by myself successfully, but when i try to run
> this program,
> error just shows up, what's wrong?
> the directory structure is as follows:
> src
>   org.test
>   org.lab

Python uses a dot as separator between different parts of nested structures, 
like e.g. the directories during import. I guess your directory naming 
conflicts with that. Try this structure instead:


or maybe


> contents of A seems like:
> class A
>     ...
> contents of B seems like:                  // I try to run,
> python import error just appears, why?

"just appears" is not a sufficient discription of an error. I'd suggest 
reading Eric S. Raymond's excellent essay on "Asking Smart Questions", it 
will avoid such mistakes.


Domino Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

More information about the Python-list mailing list