The question about pylint Unable to import

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.

Oct.14,2021

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.

  • your way: from common.utils import xxxx runs fine, but pycharm red (probably similar to pylint error report? ).
  • relative import: from .common.utils import xxxx runs fine, and pycharm is not marked red.
  • absolute import: 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. )

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37e19-2c0c6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37e19-2c0c6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?