Importing from parent directory gets error
Question: The project structure on my local machine is setup like this:

    
    
    python/
        __init__.py
        readText.py
        testing/
            __init__.py
            removeDuplicates.py
    

In removeDuplicates.py I am trying to import as follows:

    
    
    from python import readText
    

This gives: ImportError: No module name 'python'

My **init**.py in both folders are blank by the way.


Answer: You need the parent directory of your `python` subdirectory to be present in
`sys.path`. If you execute your script from that directory, the import should
work. But the easiest way to do this is to export the environment variable
PYTHONPATH.

