Not Implemented error in wxPython

浪尽此生 提交于 2019-12-25 17:19:04

问题


I'm getting this error whenever I run my wxpython code.

Traceback (most recent call last):

File "musicplayer.py", line 203, in MyPanel(frame, -1)

File "musicplayer.py", line 17, in __init__ self.mc = wx.media.MediaCtrl(self, style=wx.SIMPLE_BORDER)

File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/media.py", line 96, in __init__

_media.MediaCtrl_swiginit(self,_media.new_MediaCtrl(*args, **kwargs)) NotImplementedError

My program is to create a music player in wxpython. Any help greatly appreciated, thanks.


回答1:


The wxMediaCtrl is an optional part of the build, and it will automatically be excluded if wxWidgets' configure script was not able to finde the right dependent libraries or their -devel packages are not installed. When wxPython is built using a wxWigets without wxMediaCtrl then it creates a stub class that simply raises NotImplementedError if you try to use it.




回答2:


What version of wxPython?

On Linux, using python2.7 and wxPython 2.8.12.1, I went to my shell and started the python interpreter and issued some test commands:

python
>>> import wx.media
>>> app = wx.App()
>>> frm = wx.Frame(None)
>>> mc = wx.media.MediaCtrl(frm, style=wx.SIMPLE_BORDER)
>>>

No error, although it took about 20 seconds after hitting enter on that last line and getting the python prompt back. Can you do the same at your command shell and see if you still get the error, and if so try without the style argument?



来源:https://stackoverflow.com/questions/14302005/not-implemented-error-in-wxpython

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!