2

I've been beating my head against the wall trying to troubleshoot a graphical program with a WX backend. We've found that wxPython 2.8.10 work fine, and seemingly any newer releases doesn't. Despite all the help I received to building wxPython from source

https://stackoverflow.com/questions/27988150/how-to-get-wxpython-2-8-on-ubuntu/28031967#28031967

https://stackoverflow.com/questions/10457647/how-do-i-install-wxpython-in-virtualenv

The build process failed, and we tried every single approach listed. In any case, we found that making a symbolic link to the system-python's wx worked fine, but unfortunately apt-get install left us with 2.8.12. My question is how can I apt-get install an older version of wxpython, or any package for that matter?

I'm on Ubuntu MATE 14.04, but have verified this problem occurs on OSX and Ubuntu 12, so it's probably not an OS-dependent issue.

  • You could probably rebuild older versions on your system if they don't install directly. When you say "older version of wxpython", what version do you mean, precidely? And which release of Ubuntu is it contained in? Also, I'm unclear what the word "mate" is doing there. – Faheem Mitha Jan 20 '15 at 21:13
  • Sorry I mean Ubuntu MATE 14.04. We need version 2.8.10 of wxpython. I'll edit my question to reflect these. – Adam Hughes Jan 20 '15 at 22:30
  • Do you need 2.8.12 as well as 2.8.10 installed side by side, or would replacing 2.8.12 with 2.8.10 work for you? If the latter, you could simply build a 2.8.10 binary Debian package and stick it in the place of 2.8.12. The packaging for 2.8.12 would most likely work for 2.8.10, modulo Ubuntu-specific patches, because the versions are so similar. – Faheem Mitha Jan 20 '15 at 22:53
  • Replacing is totally fine. Would you be able to elaborate a bit about this in an answer? – Adam Hughes Jan 20 '15 at 23:04
  • Sure, but since I don't actually use your OS (Debian user), it will have to be a bit sketchy. Feel free to ask for elaboration. – Faheem Mitha Jan 20 '15 at 23:06
  • That's fine. What OS are you using? Ubuntu MATE is basically Ubuntu and should work the same. – Adam Hughes Jan 20 '15 at 23:11
  • Debian wheezy (7.7). – Faheem Mitha Jan 20 '15 at 23:31

2 Answers2

2

As you seem to have trouble compiling from source, why not install the package straight from the Ubuntu repositories?

If you do a search on http://packages.ubuntu.com/ for wxPython over all versions, you get this result and under the Package python-wxversion title on that page you will find:

lucid-updates (python): wxWidgets Cross-platform C++ GUI toolkit (wxPython version selector) [universe] 2.8.10.1-0ubuntu1.2: all

On that page, click the all button, download the package manually and install it by sudo dpkg --install python-wxversion_2.8.10.1-0ubuntu1.2_all.deb

Warning

Installing .deb files straight from the repositories, will have these packages updated automatically by the Ubuntu Software updater, so don't forget to echo python-wxversion hold | sudo dpkg --set-selections after you've painstakingly installed it to keep it at that version!
Fabby
  • 5,384
  • @AdamHughes Note that if it doesn't install cleanly for some reason, apt-get -f install is usually an effective way to remove it again. or of course you can just remove ti manually, with apt-get purge python-wxversion. – Faheem Mitha Jan 21 '15 at 13:36
  • @AdamHughes You might want to replace python-wxgtk2.8 too, from the same place. – Faheem Mitha Jan 21 '15 at 13:39
  • 1
    Thanks, I didn't know you could do this. Turns out that the older version of wxpython I need is not compatible with python 2.7, so this is all a moot point, but this did work at least in terms of getting the older version. Thanks both of you guys. – Adam Hughes Jan 21 '15 at 16:40
1

Here is a sketch of how to replace wxPython 2.8.12 with 2.8.10. This will probably work, but without actually trying it out, I can't be sure.

You might find this question/answer useful as reference: How can I install more recent versions of software than what Debian provides?. What you are trying to do here isn't exactly a backport, but it is similar.

  1. Check and see if Ubuntu happens to have a version of 2.8.10 floating around in recent releases. If so, you could try to rebuild that on your system. If not you'll need to do this the hard way.
  2. Download the source of wxPython 2.8.12.

    apt-get source python-wxgtk2.8
    

    This would download the source for wxwidgets2.8 for you. This assumes the presence of the appropriate deb-src lines in /etc/apt.sources.list.

  3. Get an upstream version of wxPython 2.8.10, unpack it, and copy the Debian directory from the wxwidgets2.8 Debian/Ubuntu source. You'll need to rename the tarball to conform to the Debian naming scheme, and also update the Debian changelog. If you can get that to build, you're good. The build command I normally use is

    debuild -uc -us
    

    using debuild from the devscripts package. You'll probably need to install some build dependencies. You could first run dpkg-checkbuilddeps to check the build dependencies situation.

  4. An alternative method is to use the sources from http://snapshot.debian.org/package/wxwidgets2.8/. These are for Debian, but will probably work on an Ubuntu system. These are Debian sources, you you can just rebuild them directly.

NOTE: If you do a successful install of 2.8.10, you will probably need to do something to stop apt and friends upgrading wxPython back to 2.8.12. There ar different ways to do this, but a simple and effective way is to use epochs. But this is a detail that can be addressed if a rebuilding effort is successful.

Faheem Mitha
  • 35,108
  • Sorry, I'm a noob. Can you elaborate on step 1: Check and see if Ubuntu happens to have a version of 2.8.10 floating around in recent releases. If so, you could try to rebuild that on your system. If not you'll need to do this the hard way. How would I check this, and if I do find it, what does it mean to rebuild? – Adam Hughes Jan 20 '15 at 23:34
  • @AdamHughes since I'm not a Ubuntu user, I'm not sure, but does Ubuntu archive earier releases of packages in any central place, like snapshot.debian.org? If not, check the version of wxPython 2.8 for the preceding version of Ubuntu. This isn't very likely to work, hence the rest of the answer, but if it did, it would be the most painless way. Rebuild just means build the sources in a binary Debian package. See the reference I added to the beginning of the question. – Faheem Mitha Jan 20 '15 at 23:38
  • Ok, well thanks for the info. I'll see if I can makesense of it and get it to work. – Adam Hughes Jan 20 '15 at 23:42
  • @AdamHughes If you are not familiar with Debian packaging, it is a useful thing to know about if you use Debian or its derivatives. There is some overhead, but it is not excessive. – Faheem Mitha Jan 20 '15 at 23:43
  • I thought Ubuntu was a Debian OS by default? But I only know this superficially – Adam Hughes Jan 20 '15 at 23:46
  • @AdamHughes Ubuntu is a Debian derivative. Meaning that it is derived from Debian, but is not itself Debian. There are other Debian derivatives, but Ubuntu is the best known. – Faheem Mitha Jan 20 '15 at 23:48
  • For the old Ubuntu archives: http://old-releases.ubuntu.com/ubuntu/dists/ – Fabby Jan 21 '15 at 00:13