首页  >  问答  >  正文

python - PyCharm 不能识别import路径问题

文件目录

spider
    -models
        -test.py
        -customer.py
    

text.py

from customer import Customer

customer = Customer()

PyCharm会提示Unresolved reference 'customer'

程序运行没问题

我想问下,如何让编辑器正确识别路径?

滿天的星座滿天的星座2686 天前891

全部回复(2)我来回复

  • 某草草

    某草草2017-06-12 09:23:26

    雷雷

    回复
    0
  • 阿神

    阿神2017-06-12 09:23:26

    从 models.customer 导入 Customer

    回复
    0
  • 取消回复