Python-Import eines Moduls aus einem Parallelverzeichnis
Wie würde ich meine Python-Importe organisieren, damit ich ein solches Verzeichnis haben kann?
project
| \
| __init__.py
|
src
| \
| __init__.py
| classes.py
|
test
\
__init__.py
tests.py
Und dann in /project/test/tests.py können classes.py importiert werden
Ich habe Code wie folgt in tests.py
from .. src.classes import(
scheduler
db
)
Und bekomme Fehler von
SystemError: Parent module '' not loaded, cannot perform relative import
Weiß jemand was zu tun?