Importing using pydev and .pth files

related to: Unresolved Import Issues with PyDev and Eclipse

Recently I moved my django package to django_trunk so I can have a development version elsewhere. I have no issue importing django, runserver, or any of that.

My issue (annoyance?) is that all of the imports are coming up as underscored red indicating an error.

Pydev clearly knows of the imports, but for whatever reason it still imports as red.

I've noticed this with a few other packages, which use a .pth file instead of a direct import. In the past I've just ignored the red, but with django it's half my screen and I'm loosing critical information.

To demonstrate:

import django #note that django is underscored as red
import sys

print django
print sys.path

module 'django' from 'C:Python27Libsite-packagesdjango_trunkdjango__init__.pyc' [...,'C:Python27Libsite-packagesdjango_trunk', ...]


尝试重新配置Interpreter,方法是转到Window - > Preferences - > PyDev - > Interpreter-Python,然后再次删除并添加Python解释器。

链接地址: http://www.djcxy.com/p/67890.html

上一篇: PyDev eclipse显示编译错误红色标记,但运行良好?

下一篇: 使用pydev和.pth文件导入