0

Running Ubuntu 14.04 with Eclipse Kepler Service Release 2 which has Pydev 4.4.0.2... and Pydev Mylyn Integration 0.6.0. My program runs with no issues. Porting it over to my new platform running Ubuntu 16.04 with Eclipse Oxygen 1A release 4.7.1A and Pydev 6.0.0... with Pydev Integration at 0.6.0 and get the following error:

from wxPython._gdi import wxBitmapFromImage ImportError: No module named wxPython._gdi 

I can import wx either in Eclipse (Console) or on a terminal shell in the new ubuntu version but get the 2nd line error when I type the 1st line. My 14.04 is running wxpython 2.8 while my new 16.04 is running 3.0 not sure if this is it however.

2 Answers 2

1

I had the same issue except I got it on unpiclikg an instane of _gdi.Colour class. Following advice from Unpickling python objects with a changed module path I was saved with:

import wx as _wx from wx import _core sys.modules['wx._gdi'] = _core 

This is a hack of course and you should be better off with a try-except as in (untested)

try: from wxPython._gdi import wxBitmapFromImage except ImportError: from wx import BitmapFromImage as wxBitmapFromImage 
Sign up to request clarification or add additional context in comments.

Comments

0

The wxPython namespace is very, very old. As in more than a decade. If I remember correctly it was deprecated in 2.7 and provided only as a thin compatibility shim in 2.8, with the intent that all should have migrated to the new wx namespace by then. The compatibility shim was removed in 2.9.

The gist of the changes is that names like wxFrame located in the wxPython namespace or one of its submodules have been changed to names like Frame in the wx namespace. In other words, it should be used like this: wx.Frame.

2 Comments

is there a way to make my program run in 16.04 without recoding?
You can get an old copy of the wxPython code and build it yourself, but that will probably be more work than updating your application.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.