I’m a Java programmer and I began to develop some modules in python.
I tried to divide the layers of abstraction with packages, but, unfortunatelly there’s a class at the root package (hokuspokus.py) trying to acess some
classes at the inner packages (videofactory.py), and it raises the error ImportError: No module named media.videofactory.
I also made a test where all my files were on a same package (hokuspokus) and everything runned just fine 🙁
I’m using Python 2.7, Windows and Aptana Studio 3 with PyDev.
I checked my PYTHONPATH and the root folder of the project was there as a source folder.
I created a google code project with all my code for this module and pydev configs : http://code.google.com/p/hokuspokus-py/source/checkout
Package Structure:
HokusPokus (source folder)
|
----hokuspokus (root package)
|
--- media (inner package)
| |
| ----videofactory.py
|
|
---- hokuspokus.py
try:
import the concrete class out of your module
if you wanna import all elements in your module u can use:
but its not the best way.