Import error, No module named xxxx

I have a project having the structure


PYTHONPATH is pointed to /example

now I open the python in terminal and type

    import prediction

it succeeded, but if I type

    import prediction.a

it returns error

    ImportError: No module named 'prediction.a'; 'prediction' is not a package

why is that? isn't that already imported as a package

The behavior you are seeing can be caused if there is a module ( or package (foo/ in your current directory that has a conflicting name.

In your case, I suspect there is a file named, and you're getting that instead of the prediction package in your examples directory.