compiling wxPythonSrc 2.4.0.2 with gcc on Debian

Hi,

I want to use wxPython, but I don't really succeed in installing it.

There is no problem with the ./configure; make; make install part of the root
dir of the package. But the wxPython/ part doesn't really work for me.

I tried on a Red Hat machine with gcc 2.96 and 3.2 and python 2.2. Didn't
work. Today I wanted to retry it, but the machine crashed while trying and is
dead now (supposedly the harddrive has broken down), so I can't give the
results of that here. :confused:

I also tried on a Debian machine with gcc 3.2 and python 2.1 and 2.2. This is
where it stops when I do a "python setup.py build":

gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DSWIG_GLOBAL
- -DHAVE_CONFIG_H -DWXP_USE_THREAD=1 -UNDEBUG -Isrc
- -I/usr/local/include/python2.2 -c contrib/glcanvas/gtk/glcanvas.cpp -o
build/temp.linux-i686-2.2/contrib/glcanvas/gtk/glcanvas.o
- -I/usr/local/lib/wx/include/gtk-2.4 -DGTK_NO_CHECK_CASTS -D__WXGTK__
- -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -I/usr/include/gtk-1.2
- -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include
contrib/glcanvas/gtk/glcanvas.cpp: In function `void*
聽聽聽SwigwxGLContextTowxObject(void*)':
contrib/glcanvas/gtk/glcanvas.cpp:99: `wxGLContext' undeclared (first use this
聽聽聽function)
contrib/glcanvas/gtk/glcanvas.cpp:99: (Each undeclared identifier is reported
聽聽聽only once for each function it appears in.)
contrib/glcanvas/gtk/glcanvas.cpp:99: `src' undeclared (first use this
聽聽聽function)
contrib/glcanvas/gtk/glcanvas.cpp:101: parse error before `)' token
contrib/glcanvas/gtk/glcanvas.cpp: In function `PyObject*
聽聽聽_wrap_new_wxGLContext(PyObject*, PyObject*, PyObject*)':
contrib/glcanvas/gtk/glcanvas.cpp:109: `_result' undeclared (first use this
聽聽聽function)
contrib/glcanvas/gtk/glcanvas.cpp:111: `wxGLCanvas' undeclared (first use this
聽聽聽function)
...
and some more of this stuff...

What could be the problem? Something to with OpenGL?

bye,
Kasper

Kasper Souren wrote:

contrib/glcanvas/gtk/glcanvas.cpp:111: `wxGLCanvas' undeclared (first use this
   function)
...
and some more of this stuff...

What could be the problem? Something to with OpenGL?

Ceratinly could be. If you don't need OpenGL, you can edit the setup.py
file like this:

BUILD_GLCANVAS = 0 # If true, build the contrib/glcanvas extension
module

And it won't attempt to build the GL Canvas.

If you do need OpenGL, someone else is going to have to help you.

-Chris

路路路

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Ceratinly could be. If you don't need OpenGL, you can edit the setup.py
file like this:

BUILD_GLCANVAS = 0 # If true, build the contrib/glcanvas extension
module

And it won't attempt to build the GL Canvas.

Thanks!

I also had to set BUILD_OGL, BUILD_STC, BUILD_XRC and BUILD_GIZMOS to 0 in
order to get somewhere. It even gave me error messagese that files do not
exist. I had been looking for an INSTALL file or something like that before,
to point me into the right direction, but I found nothing.

btw, I think I know the answer to the first question asked on
www,wxpython.org. :slight_smile:

If you do need OpenGL, someone else is going to have to help you.

I don't think I need it now. In fact, I just want to use the plt module (for
plotting) from SciPy.

But now it is installed... and I do "import wxPython" and it gives me an
ImportError: No module named wxc.

What next can I try?

bye,
Kasper

Kasper Souren wrote:

I also had to set BUILD_OGL, BUILD_STC, BUILD_XRC and BUILD_GIZMOS to 0 in
order to get somewhere.

Hmm. not a big deal if you don't need them, but those shouldn't be so
dependent on outside libararies, so I'm surprised that you had a
problem.

It even gave me error messagese that files do not
exist. I had been looking for an INSTALL file or something like that before,
to point me into the right direction, but I found nothing.

Look for the file: "BUILD.unix.txt"

btw, I think I know the answer to the first question asked on
www,wxpython.org. :slight_smile:

Actually, that's a chicken and egg problem. If wxPython WAS the standard
GUI for Python, it would come with the standard libarary, and you
wouldn't have to figure any of this out. By the way, did you try a
binary release? They've always worked for me. I'm only working with
source now because I'm trying to add some features.

I don't think I need it now. In fact, I just want to use the plt module (for
plotting) from SciPy.

Be sure to check out Chaco too, it looks very promising.

But now it is installed... and I do "import wxPython" and it gives me an
ImportError: No module named wxc.

wxc.so should be in site-packages/wxPython/, in your Python
installation. Did you run setup.py install? and did you do it with the
same Python that you are using to try it out?

Good luck,

-Chris

路路路

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Hmm. not a big deal if you don't need them, but those shouldn't be so
dependent on outside libararies, so I'm surprised that you had a
problem.

I can send the exact result if someone's interested...

> It even gave me error messagese that files do not
> exist. I had been looking for an INSTALL file or something like that
> before, to point me into the right direction, but I found nothing.

Look for the file: "BUILD.unix.txt"

Ah ok! Maybe an INSTALL that points to BUILD.* could've helped :slight_smile: To prevent
people like me from overlooking them.

Actually, that's a chicken and egg problem. If wxPython WAS the standard
GUI for Python, it would come with the standard libarary, and you
wouldn't have to figure any of this out. By the way, did you try a
binary release? They've always worked for me. I'm only working with
source now because I'm trying to add some features.

There are debian packages in stable, but Debian being conservative they are
for Python 2.1. And I need Python 2.2. Maybe I can find a package for
unstable and install that. But then I still have the problem that I decided
to build everything from source. I even *have* to do that on the other
system, since I don't have root access there.
(But the system is still dead so I can't yet retry the compilation there with
my newly gained knowledge.)

btw, On the site there's also a problem with the mentioned "apt-get install
libwxgtk2.4-python". For that you have to run the unstable distribution, and
most people don't want that... I did it for a while, but I came back to it,
and now I'm running a stable/testing system where stable packages are
prefered over testing packages.

> I don't think I need it now. In fact, I just want to use the plt module
> (for plotting) from SciPy.

Be sure to check out Chaco too, it looks very promising.

I would love to check it out, but for Chaco I also need wxPython... :confused:

> But now it is installed... and I do "import wxPython" and it gives me an
> ImportError: No module named wxc.

wxc.so should be in site-packages/wxPython/, in your Python
installation. Did you run setup.py install? and did you do it with the
same Python that you are using to try it out?

Oops, I made a mistake. There is an ImportError, but it says:
/usr/local/lib/python2.2/site-packages/wxPython/wxc.so: undefined symbol:
_ZN13wxInputStream4PeekEv

Might have something to do with gcc versions...?

bye, and thanks for the support!
Kasper

Oops I didn't make a mistake. I did a "python setup.py clean/build/install"
and now it says "ImportError: No module named wxc" again...

bye,
Kasper

路路路

On Thursday 13 February 2003 19:16, Kasper Souren wrote:

> wxc.so should be in site-packages/wxPython/, in your Python
> installation. Did you run setup.py install? and did you do it with the
> same Python that you are using to try it out?

Oops, I made a mistake. There is an ImportError, but it says:
/usr/local/lib/python2.2/site-packages/wxPython/wxc.so: undefined symbol:
_ZN13wxInputStream4PeekEv

Chris Barker wrote:

Kasper Souren wrote:

contrib/glcanvas/gtk/glcanvas.cpp:111: `wxGLCanvas' undeclared (first use this
  function)
...
and some more of this stuff...

What could be the problem? Something to with OpenGL?

Ceratinly could be. If you don't need OpenGL, you can edit the setup.py
file like this:

BUILD_GLCANVAS = 0 # If true, build the contrib/glcanvas extension
module

And it won't attempt to build the GL Canvas.

If you do need OpenGL, someone else is going to have to help you.

You just have to ensure that wxGTK's configure finds what it needs to build it, (headers and libs) and rebuild. Then it will build fine in wxPython too.

路路路

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Kasper Souren wrote:

I also had to set BUILD_OGL, BUILD_STC, BUILD_XRC and BUILD_GIZMOS to 0 in order to get somewhere. It even gave me error messagese that files do not exist. I had been looking for an INSTALL file or something like that before, to point me into the right direction, but I found nothing.

The current way of putting together the source tarball started out being experimental, but I havn't yet gone back and updated the default build options and such now that it is the normal way to do it. What you need for the above is to set IN_CVS_TREE=1, which I think is mentioned in the README.1st.txt file...

路路路

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Kasper Souren wrote:

Oops, I made a mistake. There is an ImportError, but it says:
/usr/local/lib/python2.2/site-packages/wxPython/wxc.so: undefined symbol: _ZN13wxInputStream4PeekEv

Run "ldd /usr/local/lib/python2.2/site-packages/wxPython/wxc.so" and figure out if the version of libwx* is the different from the one you just built and installed.

路路路

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Kasper Souren wrote:

路路路

On Thursday 13 February 2003 19:16, Kasper Souren wrote:

wxc.so should be in site-packages/wxPython/, in your Python
installation. Did you run setup.py install? and did you do it with the
same Python that you are using to try it out?

Oops, I made a mistake. There is an ImportError, but it says:
/usr/local/lib/python2.2/site-packages/wxPython/wxc.so: undefined symbol:
_ZN13wxInputStream4PeekEv

Oops I didn't make a mistake. I did a "python setup.py clean/build/install" and now it says "ImportError: No module named wxc" again...

Is the python you run the app with the same as the one that you ran setup.py with?

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

> Oops I didn't make a mistake. I did a "python setup.py
> clean/build/install" and now it says "ImportError: No module named wxc"
> again...

Is the python you run the app with the same as the one that you ran
setup.py with?

I use an alias to get me the right python (2.2.2). I have 2.1.3 and 2.2.1
installed because of Debian. And your line made me thinking that maybe the
"sudo python setup.py install" could be problematic. But a check with "sudo
python" shows me that it does pick the right one. So that was not the
problem.
Unless there is something weird going on where sudo sometimes takes the alias
and sometimes not, but I doubt that to be the case.

bye,
Kasper

It seems okay to me:
        libwx_gtk-2.4.so => /usr/local/lib/libwx_gtk-2.4.so (0x40225000)
        libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3
(0x407c7000)
        libm.so.6 => /lib/libm.so.6 (0x40810000)
        libc.so.6 => /lib/libc.so.6 (0x40831000)
        libgtk-1.2.so.0 => /usr/lib/libgtk-1.2.so.0 (0x40941000)
        libgdk-1.2.so.0 => /usr/lib/libgdk-1.2.so.0 (0x40a66000)
        libgmodule-1.2.so.0 => /usr/lib/libgmodule-1.2.so.0 (0x40a99000)
        libgthread-1.2.so.0 => /usr/lib/libgthread-1.2.so.0 (0x40a9d000)
        libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x40aa0000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x40ac2000)
        libdl.so.2 => /lib/libdl.so.2 (0x40b11000)
        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40b14000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40b1c000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40b2a000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40be4000)
        libtiff.so.3 => /usr/lib/libtiff.so.3 (0x40c02000)
        libz.so.1 => /usr/lib/libz.so.1 (0x40c44000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

Or should I build some more stuff from source? libgtk, gdk, glib?

bye,
Kasper

路路路

On Thursday 13 February 2003 21:08, Robin Dunn wrote:

Kasper Souren wrote:
> Oops, I made a mistake. There is an ImportError, but it says:
> /usr/local/lib/python2.2/site-packages/wxPython/wxc.so: undefined symbol:
> _ZN13wxInputStream4PeekEv

Run "ldd /usr/local/lib/python2.2/site-packages/wxPython/wxc.so" and
figure out if the version of libwx* is the different from the one you
just built and installed.

The current way of putting together the source tarball started out being
experimental, but I havn't yet gone back and updated the default build
options and such now that it is the normal way to do it. What you need
for the above is to set IN_CVS_TREE=1, which I think is mentioned in the
README.1st.txt file...

Ok. That was clear as mud :wink:

(In the meanwhile I found out that my PYTHON_PATH was set to /usr incorrectly.
So I changed it to /usr/local... but...)

So I set IN_CVS_TREE to 1. But I'm still having the same trouble. After doing
a rm -fr build/ python setup.py clean/build/install:

Python 2.2.2 (#1, Jan 23 2003, 13:27:50)
[GCC 3.2.1 20020924 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Using history file and tab completion

import wxPython

ok...
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.2/site-packages/wxPython/__init__.py", line 23,
in ?
    import wxc
ImportError: /usr/local/lib/python2.2/site-packages/wxPython/wxc.so: undefined
symbol: _ZN13wxInputStream4PeekEv

I added the "ok..." to see if it really was the __init__.py I expected it to
load.

BTW, are there other options to get wxPython installed? I can't use the
packages (no root on one machine, and don't want to run Debian unstable on
this machine), and I didn't found binary .tar.gz's - if such a thing could
exist at all.

bye,
Kasper

Kasper Souren wrote:

The current way of putting together the source tarball started out being
experimental, but I havn't yet gone back and updated the default build
options and such now that it is the normal way to do it. What you need
for the above is to set IN_CVS_TREE=1, which I think is mentioned in the
README.1st.txt file...

Ok. That was clear as mud :wink:

(In the meanwhile I found out that my PYTHON_PATH was set to /usr incorrectly. So I changed it to /usr/local... but...)

So I set IN_CVS_TREE to 1. But I'm still having the same trouble.

Well if you go back and look the old mails you'll see that that answer was for a different problem, being able to build the STC. OGL, etc. modules.

After doing a rm -fr build/ python setup.py clean/build/install:

Python 2.2.2 (#1, Jan 23 2003, 13:27:50)
[GCC 3.2.1 20020924 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Using history file and tab completion

import wxPython

ok...
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.2/site-packages/wxPython/__init__.py", line 23, in ?
    import wxc
ImportError: /usr/local/lib/python2.2/site-packages/wxPython/wxc.so: undefined symbol: _ZN13wxInputStream4PeekEv

For this problem I have to go back to the fact that it appears that the libwx_gtk being found at runtime is not the same one that was used for building wxPython. The lib appears to have been built with wxUSE_STREAMS turned off, but wxPython is trying to dynamically bind to it because the headers it used had it turned on. (In fact wxPython won't build without it.) What configure parameters did you use when building wxGTK?

BTW, are there other options to get wxPython installed? I can't use the packages (no root on one machine, and don't want to run Debian unstable on this machine), and I didn't found binary .tar.gz's - if such a thing could exist at all.

You may be able to use alien to install the RPM, but I don't know how well that will work.

路路路

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

> ImportError: /usr/local/lib/python2.2/site-packages/wxPython/wxc.so:
> undefined symbol: _ZN13wxInputStream4PeekEv

For this problem I have to go back to the fact that it appears that the
libwx_gtk being found at runtime is not the same one that was used for
building wxPython. The lib appears to have been built with
wxUSE_STREAMS turned off, but wxPython is trying to dynamically bind to
it because the headers it used had it turned on. (In fact wxPython
won't build without it.) What configure parameters did you use when
building wxGTK?

A quick check of config.status shows me that I did a plain ./configure for the
stuff in the wxPythonSrc-2.4.0.2 directory. Which is wxGTK, if I am not
mistaken.

So now I try a "rm config.cache; ./configure --enable-streams; make" and it
says me "nothing to be done for all". So this switch is not the problem.

Thus I continue with a ./configure --enable streams --enable-std_iostreams;
make.
(Why is it that a "python setup.py clean" doesn't really clean the code?)
So now I am in the wxPython dir doing a "rm -r build; python setup.py
build/install"... And my girlfriend wants me to go to sleep. So... To be
continued...

You may be able to use alien to install the RPM, but I don't know how
well that will work.

Hmm, ok. But it would only work on my own machine. There's not a slight chance
I will be able to install the rpm on the Red Hat machine...

bye,
Kasper

In the previous episode of "compiling wxPythonSrc 2.4.0.2 with gcc on Debian"
Kasper wrote:

Thus I continue with a ./configure --enable streams --enable-std_iostreams;
make.
(Why is it that a "python setup.py clean" doesn't really clean the code?)
So now I am in the wxPython dir doing a "rm -r build; python setup.py
build/install"... And my girlfriend wants me to go to sleep. So... To be
continued...

Well, it turned out to nothing. So I renamed all the python2.2 stuff in
/usr/local/ and decided to go for the Debian version of Python 2.2. Nothing.
Same problem.
Somtimes "ImportError: /usr/lib/python2.2/site-packages/wxPython/wxc.so:
undefined symbol: _ZN13wxInputStream4PeekEv" and sometimes the no wxc
ImportError.

I also tried python2.1 setup.py build/install and it works ok. At least it
doesn't give me errors when "import wxPython"ing.

So it has something to do with the Python versioning.

bye,
Kasper