Undefined variable from import when using wxPython in pydev

前端 未结 6 1650
故里飘歌
故里飘歌 2020-12-09 17:03

I just downloaded wxPython, and was running some of the sample programs from here. However, on every line that uses a variable from wx.*, I get a \"Undefined variable from i

6条回答
  •  时光取名叫无心
    2020-12-09 17:44

    PyDev finds the references when you setup the interpreter in

    Window -> Preferences -> Pydev -> Interpreter - Python
    

    If wxPython was not in your site-packages directory when you first setup the interpreter, then the references to the wx objects and names will not be known to the editor lookup function. To fix this, remove the interpreter from

    Window -> Preferences -> Pydev -> Interpreter - Python
    

    and then select new. Re-add the python installation again and press apply. At this time, Pydev will import all of the site-package objects again and should populate the lookup dictionary. You'll want to restart Eclipse for changes to take place.

提交回复
热议问题