I'm trying to build wxPython 2.9.4.0 from source on 64-bit Ubuntu 12.10.
Here is what I executed:
cd wxPython-src-2.9.4.0/wxPython
sudo python2.7 build-wxpython.py --build_dir=../bld --install
The first thing that fails is that it doesn't find these two files:
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)
I fixed this by copying wx/tools/XRCed/__init__.py (a dummy file) into
wx/lib/pubsub/pubsub2/
and into wx/tools/XRCed/plugins/ and then restarted the build. The build
fails like this:
...
running build_ext
building '_core_' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-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
-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/x86_64-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/x86_64-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-x86_64-2.7/src/helpers.o -pthread -O3 -pthread
cc1plus: warning: command line option �-Wstrict-prototypes� is valid for
C/ObjC but not for C++ [enabled by default]
src/helpers.cpp:32:36: fatal error: wx/gtk/private/win_gtk.h: No such
file or directory
There is in fact no directory wx/gtk/. The only directories under wx are
build,
lib, py, and tools.
That path is relative to the wxWidgets include folder, not something in wxPython.
What do I need to do?
You need to apply the 2.9.4.1 patch that is in the wxPython download area on SourceForge.
I successfully built wxPython 2.9.4.0 on a fresh install of Ubuntu 12.10. After applying the patch, I also had to do the following or else the build hung:
Copy the dummy file wxPython-src-2.9.4.0/wxPython/wx/lib/pubsub/init.py into
wxPython-src-2.9.4.0/wxPython/wx/lib/pubsub/pubsub2/ and also into
wxPython-src-2.9.4.0/wxPython/wx/tools/XRCed/plugins/
I then executed in wxPython “sudo python2.7 build-wxpython.py --build_dir=…/bld --install”.
After building, in /usr/local/lib/python2.7/dist-packages I found a wx-2.9.4-gtk2 folder, wx.pth pointing to that folder, and inside that folder a folder wx. In ADDITION, there is in dist-packages a folder wx whose contents are identical to the wx folder inside the wx-2.9.4-gtk2 folder! Does that make any sense?
I successfully built wxPython 2.9.4.0 on a fresh install of Ubuntu
12.10. After applying the patch, I also had to do the following or else
the build hung:
Copy the dummy file
wxPython-src-2.9.4.0/wxPython/wx/lib/pubsub/__init__.py into
wxPython-src-2.9.4.0/wxPython/wx/lib/pubsub/pubsub2/ and also into
wxPython-src-2.9.4.0/wxPython/wx/tools/XRCed/plugins/
I then executed in wxPython "sudo python2.7 build-wxpython.py
--build_dir=../bld --install".
After building, in /usr/local/lib/python2.7/dist-packages I found a
wx-2.9.4-gtk2 folder, wx.pth pointing to that folder, and inside that
folder a folder wx. In ADDITION, there is in dist-packages a folder wx
whose contents are identical to the wx folder inside the wx-2.9.4-gtk2
folder! Does that make any sense?
Not really. Is there any chance one of them was already there?
No, there was absolutely for sure nothing in dist-packages before building. I’m quite sure of this because apparently I had successfully built previously but thought I’d failed in some way because there was this extra wx folder. So I deliberately deleted everything from dist-packages before building again from scratch (which included re-unpacking from the downloaded file).
Experimentally, I find that if I delete the wx folder everything still works. Strange.
···
On Sat, Feb 23, 2013 at 1:19 PM, Robin Dunn robin@alldunn.com wrote:
Bruce Sherwood wrote:
I successfully built wxPython 2.9.4.0 on a fresh install of Ubuntu
12.10. After applying the patch, I also had to do the following or else
the build hung:
Copy the dummy file
wxPython-src-2.9.4.0/wxPython/wx/lib/pubsub/init.py into
wxPython-src-2.9.4.0/wxPython/wx/lib/pubsub/pubsub2/ and also into
No, there was absolutely for sure nothing in dist-packages before
building. I'm quite sure of this because apparently I had successfully
built previously but thought I'd failed in some way because there was
this extra wx folder. So I deliberately deleted everything from
dist-packages before building again from scratch (which included
re-unpacking from the downloaded file).
Experimentally, I find that if I delete the wx folder everything still
works. Strange.
Ok. IIRC I do some hackey stuff there to get the versioned subfolder so maybe there are some Ubuntu customizations to distutils that are confusing my tweaks, or vice-versa.
This approach looks promising. It seems possible that my repeated difficulties may have been due to turning on the install flag for the build. For example, with the install flag present, the build locked up unless I first did this:
Copy the dummy file wxPython-src-2.9.4.0/wxPython/wx/lib/pubsub/init.py into
wxPython-src-2.9.4.0/wxPython/wx/lib/pubsub/pubsub2/ and also into
wxPython-src-2.9.4.0/wxPython/wx/tools/XRCed/plugins/
WIthout the install flag, the build completes normally without doing this.
But now I have questions prompted by my ignorance and confusion over Linux environment variables and/or what kind of shell environment I’m in when I’m in a terminal. Before doing the build I executed printenv and did not see a variable named PYTHONPATH. How exactly do I see this variable, and how exactly do I set and/or modify it? The end of the build also tells me to set LIB_LIBRARY_PATH, and I have no idea how to do that, either. Details gratefully accepted!
···
On Thursday, February 21, 2013 4:52:14 PM UTC-7, patrick korsnick wrote:
Bruce, here’s my build steps for building 2.9 on ubuntu:
This method can be used to build the development version (2.9) of wxPython on linux.
Install these pre-requisites:
opensuse 12.2
zypper in gtk2-devel freeglut-devel gstreamer-0_10-devel gstreamer-0_10-plugins-base-devel python-devel
I found out from a friend about using “export” to set the variables PYTHONPATH and LIB_LIBRARY_PATH each time I execute, but that I need to put these in .profile or .bashrc to make this permanent, and with this I was at last able to build and use wxPython on 64-bit Ubuntu 12.04. It seems cleaner to me to be able to tell people building VPython on Linux that for the wxPython part they can perform an install into a place already on the standard Python module search path.
So after the successful build I tried running (in the wxPython directory)
and to my great surprise it went through the entire compilation process again, despite having already compiled everything. Is there a statement that will just do the install appropriately, after a build that apparently on 64-bit Ubuntu 12.04 must be done without the --install directive?
FYI, after the long install following the long build, I was told that that “you may need to set PYTHONPATH” to the build area, which is not necessary, whereas I was not told that I need to set LIB_LIBRARY_PATH to /usr/local/lib, without which libwx_gtk2u_adv-2.9.so.4 isn’t found because it’s in /usr/local/lib.
Thanks for the tip. On my 64-bit Ubuntu 12.04 there is a .profile and a .bashrc, but there is no file .bash_profile. Is .bash_profile something found only on other Linux distributions?
I did that, and it works. All I was commenting on was that there already existed files named .bashrc and .profile but there not a file named .bashrc_profile.
AFAIK It is not compulsory to have a .bash_profile, it gets executed
IF it exists, but it will be created by the first user or package to
need it. I think that you could potentially have a system that
doesn’t have a .bashrc either but so many packages and other
settings get stored there it is almost always already there when you
look for it.
-----Mensagem original-----
De: Boatjan Mejak<mejak.bost@gmail.com>
Para: wxpython-users@googlegroups.com
Data: Ter�a, 26 de Fevereiro de 2013 23:48
Assunto: Re: [wxPython-users] Re: Building wxPython 2.9.4.0 on Ubuntu
Bruce, try creating .bashrc file in /home/username directory and put stuff
in there in the form of
export PYTHONPATH="/some/path"
What is the simplest and fastest way to install wxPython on ubuntu 10.4
or 10.10?
If you want 2.8 then use the packages in the Ubuntu repositories. If you want 2.9 then you'll need to build it yourself as is being discussed in this thread. The wxPython/build-wxpython.py should be able to handle the whole process for you, but it's got a few warts. See wxPython/docs/BUILD.txt
Thanks Robin. 2.8 is ok for me, but I have already tried the instalation
via apt-get and pip, but it fails, as some file is not resolved. Is
there any specific repository I can manually add to apt lists, or
something like that?