How to import correctly my function from parent folder
Question: I have the following layout:

    
    
    /project
        /thomas
            /users
                /src
                    code_alpha.py
                /tests
                    code_beta.py
    

I tried:

    
    
    /project
        /thomas
            /users
                __init__.py
                /src
                    code_alpha.py
                /tests
                    code_beta.py
    

with `from users.src import code_alpha`

also tried:

    
    
     /project
            /thomas
                /users
                    __init__.py
                    /src
                        code_alpha.py
                        __init__.py
    
                    /tests
                        code_beta.py
    

with `from users.src import code_alpha`

I tried to solve the problem with this
[guide](https://docs.python.org/2/tutorial/modules.html) and some similiar
topics here, but could not figure out. Adding the directory to my path did not
solve the problem.

edit: updated layout.


Answer: Try adding `__init__.py` to `somefolder_3`.

Then in `code_beta.py` you will be able to write

`from somefolder_3.somefolder_4 import code_alpha`

