0

So i just started learning python and i'm following this tutorial: https://www.youtube.com/watch?v=RHvhfjVpSdE#t=274 . But i keep geting this error.

This is my code:

import wx class bucky(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id, 'Frame aka window', size=(300, 200)) if __name__=='__main__': app=wx.PySimpleApp() frame=bucky(parent=None,id=-1) frame.Show() app.MainLoop() 

This is my error:

Traceback (most recent call last): File "C:/Python27/gui.py", line 1, in <module> import wx File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\__init__.py", line 45, in <module> from wx._core import * File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_core.py", line 4, in <module> import _core_ ImportError: DLL load failed: %1 er ikke et gyldig Win32-program. 

Please help!

5
  • 1
    Can you translate the error to English? Seems like it's related to your operating system. Commented Sep 4, 2014 at 6:10
  • ImportError: DLL load failed: %1 er ikke et gyldig Win32-program. = importerror: DLL load failed: %1 is not a valid win32-program Commented Sep 4, 2014 at 6:12
  • 1
    Probably just Bla is not a valid win32 application Commented Sep 4, 2014 at 6:13
  • 1
    Could it be that wherever you picked up wx for the wrong OS? Commented Sep 4, 2014 at 6:18
  • Possible dupe of stackoverflow.com/questions/21741786/… Commented Sep 4, 2014 at 13:16

1 Answer 1

2

Maybe wrong installer, on Windows you have to ensure that if you installed Python 2.7 32 then you need to use a wxPython 3.0 for Python 2.7 32 bit.

Instead of using 3.0 you might want to use the preview build for 3.0.1 which you can find here: http://wxpython.kosoftworks.com/preview/20140707/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.