Need help: Error in building wxPython 2.9.4.0 from source on ubuntu 12.04 LTS 64 bit

Kam Yen Cheah wrote:

Dear all,

My OS: Ubuntu 12.04 LTS 64 bit
Machine: Lenovo Z480
The default version of Python on my machine: 2.7.3

After reading the Build Instruction, I did the following at the command
prompt:

$ *python2.7* build-wxpython.py --build_dir=../bld *--install*

And I get the following error at the end:

old_options = set(['--build_dir=../bld', '--install'])
sys.argv = ['--build_dir=../bld', '--install']
wxWidgets directory is: /home/kamyen/wxPython-src-2.9.4.0
wxWidgets build options: ['--wxpython', '--jobs=4',
'--prefix=/usr/local', '--unicode', '--installdir=', '--install',
'--builddir=/home/kamyen/wxPython-src-2.9.4.0/bld']
Configure options: ['--enable-unicode', '--prefix=/usr/local',
'--with-opengl', '--enable-sound', '--enable-graphics_ctx',
'--enable-mediactrl', '--enable-display', '--enable-geometry',
'--enable-debug_flag', '--enable-optimise', '--disable-debugreport',
'--enable-uiactionsim', '--with-sdl', '--with-gnomeprint']
/home/kamyen/wxPython-src-2.9.4.0/configure --enable-unicode
--prefix=/usr/local --with-opengl --enable-sound --enable-graphics_ctx
--enable-mediactrl --enable-display --enable-geometry
--enable-debug_flag --enable-optimise --disable-debugreport
--enable-uiactionsim --with-sdl --with-gnomeprint
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu

checking for OpenGL headers... not found
checking for GL/gl.h... no
configure: error: OpenGL libraries not available
Error running configure
ERROR: failed building wxWidgets
Traceback (most recent call last):
File "build-wxpython.py", line 378, in <module>
wxbuild.main(wxscript, build_options)
File "/home/kamyen/wxPython-src-2.9.4.0/build/tools/build-wxwidgets.py",
line 359, in main
"Error running configure")
File "/home/kamyen/wxPython-src-2.9.4.0/build/tools/build-wxwidgets.py",
line 74, in exitIfError
raise builder.BuildError(msg)
BuildError

The fact that configure is exiting with an error is odd, it should just be noting that OpenGL is not available and setting a flag that will exclude the building of wxGLCanvas later. Perhaps there is more info about why it is doing a hard fail instead in the config.log. But either way, the obvious solution would be to install the -dev packages that provide the OpenGL headers and other development files. (Most likely you want some mesa-*-dev or lib*-mesa-dev packages.)

I noticed that there are also some other warning messages in your configure output about missing libraries. You should probably install -dev packages for them too.

···

--
Robin Dunn
Software Craftsman