用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