mikezang
mikezang

Reputation: 2489

'from wx.core import *' ImportError: DLL load failed: Module Not Found

I am newer to use wxPython, at first, I use command to pip install wxPython to install wxPyhton:

pip install -U wxPython
Requirement already up-to-date: wxPython in c:\program files\python\python37\lib\site-packages (4.0.3)
Requirement already satisfied, skipping upgrade: six in c:\program files\python\python37\lib\site-packages (from wxPython) (1.11.0)
Requirement already satisfied, skipping upgrade: PyPubSub in c:\program files\python\python37\lib\site-packages (from wxPython) (4.0.0)

Then I try to run this code to show a GUI window, and source from wxPyhton example:

# set_size.py
import wx
class Example(wx.Frame):
    def __init__(self, parent, title):
        super(Example, self).__init__(parent, title=title, size=(350, 250))

def main():
    app = wx.App()
    ex = Example(None, title='Sizing')
    ex.Show()
    app.MainLoop()

if __name__ == '__main__':
    main()

But I got error `Undefined variable from import: Frame', what can I do next?

Traceback (most recent call last):
  File "C:\Users\zz250147\git\python\Scraping\prototype\set_size.py", line 6, in <module>
    import wx
  File "C:\Program Files\Python\Python37\lib\site-packages\wx\__init__.py", line 17, in <module>
    from wx.core import *
  File "C:\Program Files\Python\Python37\lib\site-packages\wx\core.py", line 12, in <module>
    from ._core import *
ImportError: DLL load failed: Module not found.

Upvotes: 0

Views: 992

Answers (1)

mikezang
mikezang

Reputation: 2489

After installed Microsoft Visual C++ 2015 Redistributable Update 3, The error gone!

Upvotes: 2

Related Questions