I have this tree format.

> myapp->
>      setup.py
>      tests ->
>           test_myapp.py
>      myapp -> 
>           __init__.py
>          myapp.py

And from test_myapp.py, I am calling: from myapp import myapp and when I runpython setup.py test I am getting No module named 'myapp'

I'd recommend using python setup.py develop first, which will install a symbolic link allowing python to import and use myapp without really installing the package. If you're using a virtualenv, make sure the command uses your virtualenv's python interpreter.

Hmm.. It worked fine now!! Thanks!