I have the following code structure running perfectly fine in my IDE(Aptana Studio):
/ProjectName/
/lib
/src
/Module1
/Module2
/Module3
__init__.py
pyClass.py ##Python Class
/main
main.py
main.py :
import Module3.pyClass as pc
myClass=pc.pyClass()
but when I try to run it from command line , import error !
importError: No module named Module3.pyClass
I am running from the /main directory. Is it because it doesn't know where to find Module3 to import?How should i tell where it should look for Module3 ?
Thank you.
import sys,print sys.path. If you don't find /path/to/ProjectName/src/ in your Python path, you need to add it. You also need to add a init.py file in src.