Create an __init__.py file in each directory that will be in the tree of your import. For example, if you have the following directory structure…
/opt/software/com/yourcompany/yourdivision/yourfile.py
…you would issue the following commands:
export PYTHONPATH=$PYTHONPATH:/opt/software touch /opt/software/com/__init__.py touch /opt/software/com/yourcompany/__init__.py touch /opt/software/com/yourcompany/yourdivision/__init__.py
You should be able to run the following successfully…
python -c "import com.yourcompany.yourdivision.yourfile"