Python - Module Not Found

后端 未结 6 539
陌清茗
陌清茗 2020-11-27 17:33

I am a beginner with Python. Before I start, here\'s my Python folder structure

-project
----src
------model
--------order.py
------hello-world.py

6条回答
  •  我在风中等你
    2020-11-27 17:59

    you need a file named __init__.py (two underscores on each side) in every folder in the hierarchy, so one in src/ and one in model/. This is what python looks for to know that it should access a particular folder. The files are meant to contain initialization instructions but even if you create them empty this will solve it.

提交回复
热议问题