未解决的pydev导入 [英] Unresolved import in pydev

查看:177
本文介绍了未解决的pydev导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Python的第一个用户,我在Windows XP和Pydev上安装了Eclipse(Helios),一切都很好,只有当我遵循 Python的GAE教程

I am a first time user of Python, I have Eclipse (Helios) on Windows XP and Pydev installed and all is well except that when I am following the GAE tutorial for Python

我在run_wsgi_app上获得未解决的导入错误, webapp从
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

I get the unresolved import error on run_wsgi_app and webapp from from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app

代码运行正常。
我找了一个答案并添加了

The code runs fine. I have looked for an answer and added

F:\Program Files\Google\google_appengine\google\ appengine\ext

F:\Program Files\Google\google_appengine\google\ appengine\ext\webapp

通过Eclipse Python解释器界面确保我的 PYTHONPATH
我已经删除并重新添加了解释器,按下Apply,重新启动Eclipse,但全部无效。

to be sure to my PYTHONPATH via the Eclipse Python Interpreter interface. I have removed and re-added the interpreter, pressed Apply, restarted Eclipse but all to no avail.

我发布这个,因为我确信很多新的具有 GAE + Python + Eclipse + Pydev 的用户将会遇到同样的问题。

I am posting this as I am sure many new users with GAE + Python + Eclipse + Pydev would have the same problem.

关于
Chris

Regards, Chris

推荐答案

添加包父目录(具有 init .py文件的第一个目录)

Add the package parent directory (the first directory with a init.py file)

F:\Program Files\Google\google_appengine

到Eclipse的外部库选项卡下的PYTHONPATH。

to the PYTHONPATH in Eclipse under the 'External Libraries' tab.

还要注意PyDev中不遵守/理解Python命名空间的错误(而不是包)。欲了解更多信息,请参阅:

Also beware of a bug in PyDev that does not respect/understand Python namespaces (as opposed to packages). For more info see:

http://sourceforge.net/tracker/index.php?func=detail&aid=3284882&group_id=85796&atid=577329

这篇关于未解决的pydev导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆