Problem importing packages

Alban Hertroys alban at magproductions.nl
Wed Apr 28 06:26:07 EDT 2004


I'm trying to create a package containing a number of classes I made, 
but I can't get it to work...

My package is structured like this:

	X/
		__init__.py
		A.py
		B.py

When I try:
  >>> import X.A

python says:
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  ImportError: No module named X.A


As far as I can see, I do it exactly like the 'documentation' says, but 
it obviously doesn't work this way. What am I missing? (clear 
documentation, obviously...)

For the record, I believe my paths are right. If I do the following, I 
can at least import class A:

 >>> import sys
 >>> sys.path.append('X')
 >>> import A

Python version is 2.3.3 on Debian Linux.



More information about the Python-list mailing list