wxpython安装出现找不到wx模块_我在Windows上使用wxPython时出现此错误import wx import error no module命名为wx"...

1586010002-jmsa.png

I'm new to wxPython. I just installed Python 2.7.9 and wxPython for 2.7 on my Windows 7.

When I try to run the "helloworld" file

#!/usr/bin/env python

import wx

app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window.

frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a top-level window.

frame.Show(True) # Show the frame.

app.MainLoop()

from the official website.I got this error

c:\Workspace>python hellowword.py

Traceback (most recent call last):

File "hellowword.py", line 2, in

import wx

ImportError: No module named wx

But none of them worked.

I've already added directory of wxPython to path "C:\Python27\Lib\site-packages". Still failed.

Could anyone help me with this, please?

Thanks in advance!

解决方案

I already fixed this by reinstalling python and wxPython, following this instruction step by step. https://www.youtube.com/watch?v=NMjV_HGLAQE

你可能感兴趣的:(wxpython安装出现找不到wx模块_我在Windows上使用wxPython时出现此错误import wx import error no module命名为wx"...)