代码改变世界

解决Eclipse Pydev中import时报错:Unresolved import

2017-08-04 10:54  linkxu  阅读(2617)  评论(1编辑  收藏  举报
project(watip)下,src folder下存在util ->TooLog.py - >GenLog类,想在src folder 下action -> LogInAction.py 下引用GenLog类:from util.TooLog import GenLog,此时报:Unresolved import,

解决方法如下:

1.在project(watip)右击打开菜单 ->选择properties->选择"PyDev-Interpreter/Grammar"->点击链接"Click here to configure an interpreter not listed." -> 在"Libraries"tab内,点击"new folder",加入util的上引目录"src"的路径->点击"ok"

3.重启eclipse.