Problems building wxPython 2.3.9.1 on RHEL5, no wxPython binary, no module _core_ or syntax error

I have tried several times to build wxPython but I just can’t seem to get it to work. I have tried python2.5 and python2.6. I haven’t been able to find what the minimum version of python required is.

I can’t install in /usr or /usr/local so I am using $HOME/local.

I’ve tried the following:

( export LD_RUN_PATH=’$ORIGIN/…/lib’; python2.5 ./build-wxpython.py --prefix=$HOME/local --build_dir=…/build --install --wxpy_installdir=$HOME/local > _INSTALL_LOG 2>&1 )

I set

PYTHONPATH:$HOME/lib/python2.5:$HOME/local/lib/python2.5:$HOME/local/lib/python2.5/site-packages

If I try to run the demo, I get

python2.5 demo/demo.py

Traceback (most recent call last):

File “demo/demo.py”, line 3, in

import Main

File “/u/eboehm/src/wxPython-src-2.9.3.1/wxPython/demo/Main.py”, line 59, in

import wx

File “/u/eboehm/src/wxPython-src-2.9.3.1/wxPython/wx/init.py”, line 45, in

from wx._core import *

File “/u/eboehm/src/wxPython-src-2.9.3.1/wxPython/wx/_core.py”, line 8704

class PySimpleApp(wx.App):

^

SyntaxError: invalid syntax

I also see no wxPython in $HOME/local/bin (should I?)

If I try python2.6

( export LD_RUN_PATH=’$ORIGIN/…/lib’; python2.6 ./build-wxpython.py --prefix=$HOME/local --build_dir=…/build --install --wxpy_installdir=$HOME/local > _INSTALL_LOG 2>&1 )

and try to run the demo

python2.6 demo/demo.py

Traceback (most recent call last):

File “demo/demo.py”, line 3, in

import Main

File “/u/eboehm/src/wxPython-src-2.9.3.1/wxPython/demo/Main.py”, line 59, in

import wx

File “/u/eboehm/src/wxPython-src-2.9.3.1/wxPython/wx/init.py”, line 45, in

from wx._core import *

File “/u/eboehm/src/wxPython-src-2.9.3.1/wxPython/wx/_core.py”, line 4, in

import core

ImportError: No module named core

Any suggestions would be appreciated.

···

Eric Boehm

I have tried several times to build wxPython but I just can't seem to
get it to work. I have tried python2.5 and python2.6. I haven't been
able to find what the minimum version of python required is.

The current minimum is 2.6

I can't install in /usr or /usr/local so I am using $HOME/local.

I also see no wxPython in $HOME/local/bin (should I?)

No.

If I try python2.6

( export LD_RUN_PATH='$ORIGIN/../lib'; python2.6 ./build-wxpython.py
--prefix=$HOME/local --build_dir=../build --install
--wxpy_installdir=$HOME/local > _INSTALL_LOG 2>&1 )

and try to run the demo

python2.6 demo/demo.py
Traceback (most recent call last):
File "demo/demo.py", line 3, in <module>
import Main
File "/u/eboehm/src/wxPython-src-2.9.3.1/wxPython/demo/Main.py", line
59, in <module>
import wx
File "/u/eboehm/src/wxPython-src-2.9.3.1/wxPython/wx/__init__.py", line
45, in <module>
from wx._core import *
File "/u/eboehm/src/wxPython-src-2.9.3.1/wxPython/wx/_core.py", line 4,
in <module>
import _core_
ImportError: No module named _core_

This may be because you are still in the wxPython folder, which has a wx subfolder, so Python is trying to load it from there instead of from your install path. Try changing into the demo folder and try running it again. You will also need to set LD_LIBRARY_PATH to $HOME/local/lib so the wxPython extension modules can find the wx shared libraries.

···

On 5/2/12 8:36 AM, Eric Boehm wrote:

--
Robin Dunn
Software Craftsman

> I have tried several times to build wxPython but I just can't seem to
> get it to work. I have tried python2.5 and python2.6. I haven't been
> able to find what the minimum version of python required is.

The current minimum is 2.6

OK. I rebuilt with python2.6

This may be because you are still in the wxPython folder, which has a wx
subfolder, so Python is trying to load it from there instead of from
your install path. Try changing into the demo folder and try running it
again. You will also need to set LD_LIBRARY_PATH to $HOME/local/lib so
the wxPython extension modules can find the wx shared libraries.

This was the problem. I changed into the demo folder and set
LD_LIBRARY_PATH and it worked. It also works without setting
LD_LIBRARY_PATH because I set LD_RUN_PATH='$ORIGIN/../LIB' during the
build. My intent was to avoid the need to set LD_LIBRARY_PATH.

Thanks for your help.

···

On May 2, 2:32 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 5/2/12 8:36 AM, Eric Boehm wrote:

--
Eric Boehm