PyDev can't see class from PyTables

ぃ、小莉子 提交于 2020-01-15 20:10:38

问题


I've installed pytables under windows 7 64 bit and it passes all the tests. Both python from command prompt and IDLE can successfully see the StringCol class, and even the python console in Eclipse can see it.

However, PyDev's autocomplete can't discover the class, and editor keeps displaying an error that says undefined variable: StringCol

Despite the error, the following code runs successfully in eclipse, using PyDev

from tables import *

if __name__ == '__main__':
    a = StringCol(34)
    print (a)

I've switched workspaces, created projects from scratch, deleted the pyc that contains the class. Nothing seems to help. How do I make pydev recognize the class which is obviously sitting where it is supposed to?


回答1:


Have you configured the "forced builtins" in the interpreter. From the getting-started guide:

Additionally, you may add other libraries that you want to treat as builtins, such as os, wxPython, OpenGL, etc. This is very important, because PyDev works on the java side only with static information, but some modules don't have much information when analyzed statically, so, PyDev creates a shell to get information on those.



来源:https://stackoverflow.com/questions/16668152/pydev-cant-see-class-from-pytables

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!