Installing wxPython 2.8 from Source - Ubuntu 12.04 - Compile Error

navneethc@gmail.com wrote:

Hi. First time user/installer here. Following the instructions found at
installation - Installing wxPython on Ubuntu 12.04 - Stack Overflow
<http://stackoverflow.com/a/14008087&gt;I ended up with an error while
installing the program.

First of all, is there a reason that you need to build it yourself instead of just using the wxPython already in Ubuntu's package repository? They already have 2.8.12.1 there which is the main reason why there are not packages built for the newer versions of Ubuntu in the repository at apt.wxwidgets.org.

Here's the error:

    building '_core_' extension
    creating build-gtk2.unicode/temp.linux-i686-2.7
    creating build-gtk2.unicode/temp.linux-i686-2.7/src
    creating build-gtk2.unicode/temp.linux-i686-2.7/src/gtk
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
    -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table
    -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -Iinclude
    -Isrc -I/usr/include/python2.7 -c src/helpers.cpp -o
    build-gtk2.unicode/temp.linux-i686-2.7/src/helpers.o -O3
    cc1plus: warning: command line option �-Wstrict-prototypes� is valid
    for Ada/C/ObjC but not for C++ [enabled by default]
    In file included from src/helpers.cpp:16:0:
    include/wx/wxPython/wxPython_int.h:19:19: fatal error: wx/wx.h: No
    such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1

It is not finding the main header for wxWidgets, which probably means that it was not properly installed, (either the libwxgtk2.8-dev package, or if you built it yourself then you didn't do a "make install".)

What command did you use for the build? Do you have a wx-config command on your PATH? If so what does it print if you run the "wx-config --cxxflags" command? Were there any other messages before those listed above about not being able to find wx-config, or other error or warning messages?

···

--
Robin Dunn
Software Craftsman

First of all, is there a reason that you need to build it yourself
instead of just using the wxPython already in Ubuntu’s package
repository? They already have 2.8.12.1 there which is the main reason
why there are not packages built for the newer versions of Ubuntu in the
repository at apt.wxwidgets.org.

Well, here’s a smack-the-forehead-worthy moment. Before getting the source, I naturally searched the Software Centre, but what I found were a handful of programs that were based/dependent on wxWidgets. To be honest, I was very surprised that there was nothing more available. Now, after reading your post, I checked again, and there’s this tiny link right at the bottom, barely visible: “Show 19 more technical items”. (For a distro that seeks pixel-perfect design, that was really terrible!) I clicked it, and there they are, all the wxPython packages! Although I see a lot of 2.6 packages as well.

It is not finding the main header for wxWidgets, which probably means
that it was not properly installed, (either the libwxgtk2.8-dev package,
or if you built it yourself then you didn’t do a “make install”.)

What command did you use for the build? Do you have a wx-config command
on your PATH? If so what does it print if you run the “wx-config
–cxxflags” command? Were there any other messages before those listed
above about not being able to find wx-config, or other error or warning
messages?

Thanks for this. But here’s a surprise: I come back after nearly a day, boot the computer – lo and behold, I can import the wx module without a problem! I wrote a small test program (which simply generates a frame) to check, and it works! I’m not sure what happened in the interim.

In any case, thank you for the prompt reply.

Regards,
Navneeth

···

On Tuesday, 23 April 2013 05:54:10 UTC+5:30, Robin Dunn wrote: