python - PyCharm cannot recognize the import path problem
滿天的星座
滿天的星座 2017-06-12 09:21:26
0
2
851

File Directory

spider
    -models
        -test.py
        -customer.py
    

text.py

from customer import Customer

customer = Customer()

PyCharm will prompt Unresolved reference 'customer'

The program runs without problems

I would like to ask, how to make the editor correctly identify the path?

滿天的星座
滿天的星座

reply all(2)
某草草
from .customer imort Customer
或者
from models.customer import Customer
阿神

from models.customer import Customer

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!