I’ve stayed away from wxPython in the past because updates were slow and Python 3 wasn’t supported. Within the last couple of weeks, 4.0
was completed, which at least answers the Python 3 problem. I’ve been pounding my head against X11 idiosyncracies all weekend, so I thought I’d take a break and try it out.
Dependencies
It looks like the prequisites were sourced from Debian.
$ sudo dnf install -y {dpkg,freeglut,gstreamer{,1}-plugins-ba{se,d-free},gtk3,lib{jpeg,notify,SM,tiff},python{2,3},SDL}{,-devel} @development-tools |
Feel free to skip ahead; the tangent is here because it’s funny.
Tangent
One of the primary dependencies, libwebkitgtk-3.0
, hasn’t been updated for over a year (in the official repos). If you want, you can install that via something like this:
$ sudo dnf install https://rpmfind.net/linux/fedora/linux/releases/26/Everything/x86_64/os/Packages/w/webkitgtk3-2.4.11-5.fc26.x86_64.rpm |
However, the prerequisites ask for some newer files, so I’d recommend building from source. Get a fresh release from the source and follow the build instructions. There are, unsurprisingly, a plethora of additional dependencies.
$ sudo dnf install -y ninja-build gperf {geoclue2,gobject-introspection,gtk2,hyphen,lib{secret,soup,tasn1,webp,xslt},sqlite}{,-devel} |
I had a really strange issue with libEGL.so.1.0.0
being missing. There were some good threads that sent me down some rabbit trails. I ended up relinking the file because I can’t for the life of me figure out why it wasn’t rebuilding.
$ symlinks /usr/lib64/ | grep EGL |
I actually did these steps first. I discovered each of those extra dependencies above the hard way.
$ curl -fLO https://www.webkitgtk.org/releases/webkitgtk-2.18.6.tar.xz |
It took my machine about an hour to build (13:03-13:55). So much for a quick and simple distraction.
It also consumes a substantial amount of storage to build. When you’re done, don’t forget to nuke the build directory.
$ cd .. |
Of course, immediately after I did that, I learned why I couldn’t find webkitgtk3
. It’s because webkitgtk4
is in the repos. And a newer release to boot.
Back on Track
$ sudo dnf install webkitgtk4{,-jsc}{,-devel} webkitgtk4-plugin-process-gtk2 |
Once that’s done, you should be able to install wxPython via pip
.
$ pip install --user wxpython |
Having spent two hours installing this (when it should have taken 30 minutes), I think I’m done with wxPython for the day. More later, most likely.
Caveat
I might have already installed some of the necessary dependencies and missed them. I did most of an installation in Vagrant before I ran out of memory (wxPython also pegs things out). But actually having webkitgtk4
accessible in the repos made a world of difference.
Full Dependency List
Some of these might be unnecessary, e.g. you might not need Python 2 unless you work with it.
@development-tools |
Legal
The old wxPython logo is licensed under CC BY-SA 3.0. The new logo doesn’t include a similar CC license in the repo but, at bare minimum, is covered by the wxWindows Library Licence. Stay awesome.