Python: Not able to import module from sibling directory -


i using python 3.4

i have cloned git repo has structure this:

parent_dir/       .       .#random things       .        sub_dir/                sub_dir1/                     __init__.py                     file1.py                sub_dir2                     __init__.py                     file2.py                sub_dir3                     file3.py                __init__.py 

content of file2.py

from sub_dir.sub_dir1.file1 import attibute1 #ok sub_dir.sub_dir3.file3 import attribute1 #gives error there no module named sub_dir3 

i tried add __init__.py file sub_dir3 still gave same error. tried experiment created own project similar structure in case works fine.

is there obvious overlooking in original package working with?

my ide pycharm.

i looked through these1,2, questions, couldn't find answer.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -