Ich möchte eine Funktion aus einer anderen Datei im selben Verzeichnis importieren.from .mymodule import myfunction
< /code>
from mymodule import myfunction
< /code>
...but the other one gives me one of these errors:
ImportError: attempted relative import with no known parent package
< /code>
ModuleNotFoundError: No module named 'mymodule'
< /code>
SystemError: Parent module '' not loaded, cannot perform relative import
< /code>
Why is this?
Relative Importe in Python 3 ⇐ Python
-
- Similar Topics
- Replies
- Views
- Last post