我有一个文件夹:locust_runner
。其中有两个文件:locust_runner.py
和locust_maker.py
。在locust_maker.py
中,我要导入在locust_runner
中定义的所有内容。
如果我这样做:
from .locust_runner import *
没有突出显示表明这是错误。但是,如果我运行它,则会得到:
SystemError: Parent module '' not loaded, cannot perform relative import
我尝试了from locust_runner import locust_runner
的其他所有组合以及我能想到的所有其他方法,但是没有任何效果。如何使它起作用?