parent_folder/
__init__.py
mypackage/
__init__.py
mymodule.py
mycode/
__init__.py
mycode.py
mymodule.py:
def myfun():
print("Hello world")
mycode.py:
from mypackage.mymodule import myfun
myfun()
当我运行mycode.py时,ModuleNotFoundError:没有名为' mypackage'弹出。 有谁知道为什么?