I have a model module in my flask service, which I import under other py, such as from model.trip import xxx. Then use pylint to check the error Unable to import, but the program can be executed normally. Ask for advice on how to solve it.
I have a model module in my flask service, which I import under other py, such as from model.trip import xxx. Then use pylint to check the error Unable to import, but the program can be executed normally. Ask for advice on how to solve it.
change the import method. (I don't know your specific directory structure, and I can't give specific suggestions.)
for example: the
directory structure is proj/agent/common
. I want to import common.util
into the .py
file under the agent
directory.
from common.utils import xxxx
runs fine, but pycharm
red (probably similar to pylint
error report? ). from .common.utils import xxxx
runs fine, and pycharm
is not marked red. from proj.common.utils import xxxx
runs fine, and pycharm
is not marked red. (a vegetable chicken. I hope all of you who pass by will not hesitate to comment on what you have said wrong. )