我有一个小型python项目,形状如下:
PythonApp/
src/
configs/
__init.py__
config.py
strategies/
myAlgorithm.py
在config.py中,我只有一些变量声明,比如IP_ADDR='192.168.1.1' 我想在myAlgorithm.py中使用它们
到目前为止我所做的:
在myAlgorithm.py中,当我将鼠标悬停在IP_ADDR上时,Visual Studio会向我显示其值“192.168.1.1”,因此一切看起来都很好,但当我运行脚本时,会出现以下错误:
from ..configs import config
ImportError: attempted relative import with no known parent package
我有点迷路了,希望你能帮助我
提前感谢,
目前没有回答
相关问题 更多 >
编程相关推荐