本文介绍了我在Windows上使用wxPython时出现此错误import wx import error no module命名为wx"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是wxPython的新手。我刚刚在Windows 7上安装了Python 2.7.9和wxPython for 2.7。
当我尝试运行helloworld文件时

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 <module>
    import wx
ImportError: No module named wx

我看过了stacksoverflow上的其他帖子,例如

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

这篇关于我在Windows上使用wxPython时出现此错误import wx import error no module命名为wx&quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 09:09