python - How to import correctly my function from parent folder -
i have 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 solve problem guide , similiar topics here, not figure out. adding directory path did not solve problem.
edit: updated layout.
did run python script running command: python code_beta.py
in folder tests
? if did, can create __init__.py
in tests
, try run: python -m users.test.code_beta
in thomas
floder (make sure have __init__.py
in floder users
, test
, src
).
Comments
Post a Comment