Python won't find variable in module

风格不统一 提交于 2019-12-05 11:54:45
cowhi

ok, I found the answer finally. I never really had an error. I did not find that out because I never tried to actually run the script because the editor indicated there was an error... The maker of PyDev answered the following question himself and provides a workaround:

How do I fix PyDev "Undefined variable from import" errors?

For code in your project, the only way is adding a comment saying that you expected that (the static code-analysis only sees what you see, not runtime info -- if you opened that module yourself, you'd have no indication that main was expected).

You can use ctrl+1 (Cmd+1 for Mac) in a line with an error and pydev will present you an option to add a comment to ignore that error.

Is Eclipse using the same version of python as what you are running in the shell (console)? Does Eclipse know where to find theano- does it have a PYTHONPATH setting for it?

What OS are you using?

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