且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python与Eclipse导入问题

更新时间:2022-11-16 16:32:45

在我的安装中,我还有其他几个库系统pythonpath对话框包括wx。尝试重新设置解释器,以便重新加载库或手动加载库。


I use eclipse as my IDE for python. Recently I encountered a strange problem.
A file contains an import from external libraries (such as wx, matplotlib etc.) if I put it inside the src directory, it will run as expected, but in the editor, I get error marks all over the places where I use the imported libraries. The errors say things like "Undefined variable from import".
If I put it in top level of the project, the error marks disappear.

I have added a screenshot of the configuration. I have a feeling that the source of the problem is there, but do not know what to do.

In my installation I have several other libraries in the system pythonpath dialog including wx. Try setting the interpreter again in order to reload the libraries or load them manually.