Eclipse + Pydev開發Python時import報錯

用eclipse +PyDev開發python時,需要import其他文件時eclipse會報錯,但是在python的命令行中運行卻沒有問題。


下面是問題的解決方法:
pip新下載的包
  1.右鍵工程——properties
  2.選擇Pydev-Interface/Grammar,點擊鏈接Click here to configure aninterpreter not listed
  3.將Python的包重新選擇一遍再導入
自己寫的模塊
  1.右鍵工程——properties
  2.選擇Pydev-Interface/Grammar,點擊鏈接Click here to configure aninterpreter not listed
  3.在下方的選擇框中點擊New Folder,然後將自己寫的模塊所在父目錄導入即可


去掉拼寫檢查
window - Preferences - General - Editors - Text Editors - Spelling - Enable spell checking

發佈了51 篇原創文章 · 獲贊 10 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章