ich arbeite gerade an einem Projekt und versuche ihm eine sinnvolle Struktur zu geben. Aktuell sieht die Struktur so aus:
Code: Alles auswählen
.
├── Pipfile
├── Pipfile.lock
└── demo
├── demo
│ ├── __init__.py
│ ├── __main__.py
│ ├── __pycache__
│ │ └── __main__.cpython-37.pyc
│ ├── config.py
│ ├── module1.py
│ └── module2.py
└── tests
├── __main__.py
├── test1.py
├── test2.py
└── testdata.py
Code: Alles auswählen
$ pwd
.../Demo/demo
$python demo
Traceback (most recent call last):
File "…Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "…Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "demo/__main__.py", line 2, in <module>
from .module1 import demo_function1
ImportError: attempted relative import with no known parent package
Hier gibt es das Projekt als download: https://filebin.net/j3b578u9856iv8cb/De ... t=nkhk4k7k
Jnnk