trying to make paths work - attempted relative import beyond top-level package
问题 I can't make this work.. My structure is: program_name/ __init__.py setup.py src/ __init__.py Process/ __init__.py thefile.py tests/ __init__.py thetest.py thetest.py: from ..src.Process.thefile.py import sth Running: pytest ./tests/thetest.py from program_name gives : ValueError: attempted relative import beyond top-level package I tried also other approaches but i am receiving various errors. But I would expect for the above to work. 回答1: ValueError: Attempted relative import in non-package