在设置文件里:

import sys

sys.path.insert(0,os.path.join(BASE_DIR,"要导包的目录名"))

用pycharm时,如果导包后没有自动提示,可以把导包的目录名标记为Sources Root

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2022-12-23
  • 2021-06-01
  • 2021-08-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2022-01-01
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案