PyCharm引入自定義類報錯


This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.

 

上面大致意思:

import 不能識別自定義包名,該類或者包沒有灌入python引入庫中

 

解決方案:右擊pycharm中項目名-->Mark Directory as -->Resource root

 

意思:自定義的資源加入到該項目中,這樣才能被 import 識別


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM