ModuleNotFoundError: No Module Named '…' [Python]

后端 未结 2 1271
傲寒
傲寒 2021-01-27 10:27

I have only written stand alone script before in Python. Now I am trying to write an app which can transform and migrate data between two databases. But when I am trying to crea

2条回答
  •  暖寄归人
    2021-01-27 10:52

    Here's the full code including the __init__.py

    File - db/__init__.py

    from .DataSource import *
    from .RecordSet import * 
    

    File - main/__init__.py

    from .main import *
    

    File - PQF/__init__.py

    from .db import *
    from .main import *
    
    from db import DataSource as database
    from db import RecordSet
    
    def main():
       print("hello")
    

    Run the main.py script as python3 -m main.main

提交回复
热议问题