In the same directory, I wish to import a function from another file.
One of the following usually works:
from .mymodule import myfunction
from mymodule import myfunction
The other, however, produces one of the following errors:
ImportError: attempted relative import with no known parent package
ModuleNotFoundError: No module named 'mymodule'
SystemError: Parent module '' not loaded, cannot perform relative import
Why is this?