Linux & wxPython 2.9.3.1

1,912 views
Skip to first unread message

blissend

unread,
May 29, 2012, 3:47:16 PM5/29/12
to wxpytho...@googlegroups.com
Hi,

I'm having a lot of trouble getting wxPython 2.9.3.1 to build on Linux without error. My goal is to make a Linux version of my program with something like pyinstaller but unfortunately for me it needs wxPython 2.9 instead of 2.8. So my question is, what's the easiest way to go about this? Is there a preferred Linux distro, get latest from something like svn instead, troubleshoot the build errors, or just forget about my preconception with the coolness 2.9 brings and stick to rewriting for 2.8 since it's ready to go on Linux? Perhaps I'm missing something here but I just can't seem to make any headway here.

I'm currently using a virtualbox ubuntu setup (was using fedora before having problems there too) and I now run into this error...

 
 The installation of wxWidgets is finished.  On certain
 platforms (e.g. Linux) you'll now have to run ldconfig
 if you installed a shared library and also modify the
 LD_LIBRARY_PATH (or equivalent) environment variable.
 
 wxWidgets comes with no guarantees and doesn't claim
 to be suitable for any purpose.
 
 Read the wxWindows Licence on licencing conditions.
 
 ------------------------------------------------------
 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
DESTDIR:
PREFIX: /usr/local
wxlocation: /usr/local
wxcfg: /usr/local/bin/wx-config
wxcfgsrc: /usr/local/lib/wx/config/gtk2-unicode-2.9
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
**** /usr/bin/python2.7 -u ./setup.py build UNICODE=1 BUILD_BASE=build WX_CONFIG="/usr/local/bin/wx-config --prefix=/usr/local"
WARNING: WXWIN not set in environment. Assuming '..'
Preparing CORE...
Preparing STC...
Preparing GLCANVAS...
Preparing GIZMOS...
running build
running build_py
running build
running build_py
copying wx/__version__.py -> build/lib.linux-i686-2.7/wx
copying wx/build/build_options.py -> build/lib.linux-i686-2.7/wx/build
package init file 'wx/lib/pubsub/pubsub2/__init__.py' not found (or not a regular file)
package init file 'wx/tools/XRCed/plugins/__init__.py' not found (or not a regular file)
package init file 'wx/lib/pubsub/pubsub2/__init__.py' not found (or not a regular file)
package init file 'wx/tools/XRCed/plugins/__init__.py' not found (or not a regular file)
running build_ext
building '_core_' extension
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 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -Iinclude -Isrc -I/usr/local/lib/wx/include/gtk2-unicode-2.9 -I/usr/local/include/wx-2.9 -I/usr/include/gtk-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/python2.7 -c src/helpers.cpp -o build/temp.linux-i686-2.7/src/helpers.o -pthread -O3 -pthread
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
src/helpers.cpp:15:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
ERROR: failed building wxPython.

FYI Thanks to everyone that's helped me in the past!

Thanks,
Adam

Chris Barker

unread,
May 29, 2012, 4:45:58 PM5/29/12
to wxpytho...@googlegroups.com
Hi,


On Tue, May 29, 2012 at 12:47 PM, blissend <blis...@gmail.com> wrote:
> src/helpers.cpp:15:20: fatal error: Python.h: No such file or directory
> compilation terminated.

This is pretty basic -- you either don't have the Python headers installed:

Do you have the "*-devel" or whatever they are called packages for
python installed?

Or they are installed, but the wx build can't find them.

-Chris




--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

blissend

unread,
May 29, 2012, 5:40:54 PM5/29/12
to wxpytho...@googlegroups.com
Oh you! Taking my overly complicated explanation of the problem and basically telling me hey you forgot to plug in the power cord!

Anyway, thanks a million! It worked wonderful after installing the python-dev* stuff.

Robin Dunn

unread,
Jul 24, 2012, 1:12:03 PM7/24/12
to wxpytho...@googlegroups.com
On 7/24/12 3:26 AM, Sanjit wrote:
>
> I am trying with latest release wxPython 2.9.4.0 and getting error as
> follows.
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> DESTDIR:
> PREFIX: /usr/local
> wxlocation: /usr/local
> wxcfg: /usr/local/bin/wx-config
> wxcfgsrc: /usr/local/lib/wx/config/gtk2-unicode-2.9
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> **** /usr/bin/python -u ./setup.py build UNICODE=1 BUILD_BASE=build
> WX_CONFIG="/usr/local/bin/wx-config --prefix=/usr/local"
> WARNING: WXWIN not set in environment. Assuming '..'
> Preparing CORE...
> Preparing STC...
> Preparing GLCANVAS...
> Preparing GIZMOS...
> running build
> running build_py
> running build
> running build_py
> copying wx/__version__.py -> build/lib.linux-i686-2.6/wx
> copying wx/build/build_options.py -> build/lib.linux-i686-2.6/wx/build
> package init file 'wx/lib/pubsub/pubsub2/__init__.py' not found (or not
> a regular file)
> package init file 'wx/tools/XRCed/plugins/__init__.py' not found (or not
> a regular file)
> package init file 'wx/lib/pubsub/pubsub2/__init__.py' not found (or not
> a regular file)
> package init file 'wx/tools/XRCed/plugins/__init__.py' not found (or not
> a regular file)
> running build_ext
> building '_core_' extension
> gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
> -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g
> -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
> -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC
> -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE
> -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL
> -D__WXGTK__ -Iinclude -Isrc -I/usr/local/lib/wx/include/gtk2-unicode-2.9
> -I/usr/local/include/wx-2.9 -I/usr/include/gtk-2.0
> -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo
> -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
> -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1
> -I/usr/include/freetype2 -I/usr/include/libpng12
> -I/usr/include/python2.6 -c src/helpers.cpp -o
> build/temp.linux-i686-2.6/src/helpers.o -pthread -O3
> src/helpers.cpp:32:36: error: wx/gtk/private/win_gtk.h: No such file or
> directory

>
> Can anybody help me to install wxPython on CentOS6.

Hmmm... It looks like wx/gtk/private/win_gtk.h was removed from the list
of files to be installed, although it is still there in the source tree.

A quick workaround for you would be to manually copy that file into the
appropriate destination folder, and also wx/gtk/dc.h which is also
missing, and then run build-wxpython.py again.

I'll look into doing a permanent fix and perhaps a .1 release...


--
Robin Dunn
Software Craftsman
http://wxPython.org



Robin Dunn

unread,
Jul 24, 2012, 2:45:01 PM7/24/12
to wxpytho...@googlegroups.com
I've uploaded a new patch file that will fix this problem to
SourceForge. You can get it here:

http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/wxPython-src-2.9.4.1.patch/download

Since this affects only source builds using wxGTK I'm not going to make
new binaries for OSX or Windows, or do a full release.

Robin Dunn

unread,
Oct 16, 2012, 7:29:09 PM10/16/12
to wxpytho...@googlegroups.com
On 10/13/12 2:13 PM, Daniel Herrera wrote:
> Hi Robin,
>
> I have read this post and thanks to your patch I could install wxPython
> 2.9.4.1. However I don't know where wxPython is installed (wx-2.9.4-gtk2
> in my python 2.7 site-packages only have wx folder). Therefore I still
> having this 'wxPython.wx' not found error.
>

The "wxPython" package was dropped in 2.7 and replaced with some
compatibility modules, (which were pretty much not working by the later
2.8 releases.) In 2.9 it was dropped entirely and there is now only the
"wx" package. What do you get if you run "import wx" ?

Daniel Herrera

unread,
Oct 17, 2012, 8:51:54 AM10/17/12
to wxpytho...@googlegroups.com
Hi Robin,

I have already installed the stable version 2.8.12.1 and I can work with wxPython, however I'm facing issues with Boa constructor. I will try to come back in 2.9.4.1 later and I will post here the result of changing from wxPython.wx import * to import wx (actually my code includes both lines). Thank you Robin!

Daniel.
Reply all
Reply to author
Forward
0 new messages