文章詳情頁(yè)
python - PyCharm 不能識(shí)別import路徑問題
瀏覽:80日期:2022-06-29 16:25:43
問題描述
文件目錄
spider -models-test.py-customer.py
text.py
from customer import Customercustomer = Customer()
PyCharm會(huì)提示Unresolved reference ’customer’
程序運(yùn)行沒問題
我想問下,如何讓編輯器正確識(shí)別路徑?
問題解答
回答1:from .customer imort Customer或者from models.customer import Customer回答2:
from models.customer import Customer
上一條:python selenium 獲取圖片驗(yàn)證碼下一條:python - 為什么用requests.get網(wǎng)址后,用.text響應(yīng)內(nèi)容為字典的形式,卻type它為str
相關(guān)文章:
1. python - 獲取到的數(shù)據(jù)生成新的mysql表2. javascript - js 對(duì)中文進(jìn)行MD5加密和python結(jié)果不一樣。3. mysql里的大表用mycat做水平拆分,是不是要先手動(dòng)分好,再配置mycat4. window下mysql中文亂碼怎么解決??5. sass - gem install compass 使用淘寶 Ruby 安裝失敗,出現(xiàn) 4046. python - (初學(xué)者)代碼運(yùn)行不起來,求指導(dǎo),謝謝!7. 為啥不用HBuilder?8. python - flask sqlalchemy signals 無法觸發(fā)9. python的文件讀寫問題?10. 為什么python中實(shí)例檢查推薦使用isinstance而不是type?
排行榜

熱門標(biāo)簽