Configuration fails for wxPython-4.0.0b2 in Python 2.7 virtualenv

Hi,

I’ve been trying to install wxPython on a Centos 6.9 machine this week. The first hurdle I had to jump was getting Python 2.7 installed on the system in a virtual environment as 2.7 was a requirement for this project. That was straightforward and installed with the instructions here: https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/

Using virtualenv, I was able to installed other dependencies on my current project using pip just fine. But, when I went to install wxPython it failed. Since then I was able to track down several packages that I didn’t have, but I think I’ve probably got most at this point.

I’ve downloaded the wxPython-4.0.0b2 tar ball, and when I execute build.py with the build_py option I get a configuration fail error. Specifically,

#I enter virtualenv inside the wxPython-4.0.0b2 directory
source ~/my27project/bin/activate
#Execute build.py command virtual environments python
/local/data/fritz2/gmosby/my27project/bin/python build.py build_py

``

The output to the screen is:

Setting top to : /local/data/fritz2/gmosby/Downloads/wxPython-4.0.0b2

Setting out to : /local/data/fritz2/gmosby/Downloads/wxPython-4.0.0b2/build/waf/2.7/gtk3

Checking for ‘gcc’ (c compiler) : /usr/bin/gcc

Checking for ‘g++’ (c++ compiler) : /usr/bin/g++

Checking for program python : /local/data/fritz2/gmosby/my27project/bin/python

Checking for python version : (2, 7, 14, ‘final’, 0)

Checking for library python2.7 in LIBDIR : not found

Checking for library python2.7 in python_LIBPL : not found

Checking for library python2.7 in $prefix/libs : not found

Checking for library python2.7m in LIBDIR : not found

Checking for library python2.7m in python_LIBPL : not found

Checking for library python2.7m in $prefix/libs : not found

Checking for library python27 in LIBDIR : not found

Checking for library python27 in python_LIBPL : not found

Checking for library python27 in $prefix/libs : not found

Checking for program /local/data/fritz2/gmosby/my27project/bin/python-config,python2.7-config,python-config-2.7,python2.7m-config : /local/data/fritz2/gmosby/my27project/bin/python-config

Checking for header Python.h : :frowning:

Asking python-config for pyembed --cflags flags : yes

Asking python-config for pyembed --libs flags : yes

Asking python-config for pyembed --ldflags flags : yes

Getting pyembed flags from python-config : Could not build a python embedded interpreter

The configuration failed

(complete log in /local/data/fritz2/gmosby/Downloads/wxPython-4.0.0b2/build/waf/2.7/gtk3/config.log)

Will build using: “/local/data/fritz2/gmosby/my27project/bin/python”

2.7.14 (default, Jan 17 2018, 11:29:22)

[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]

Python’s architecture is 64bit

cfg.VERSION: 4.0.0b2

Running command: build_py

Checking for /local/data/fritz2/gmosby/Downloads/wxPython-4.0.0b2/bin/waf-1.7.15-p1…

“/local/data/fritz2/gmosby/my27project/bin/python” /local/data/fritz2/gmosby/Downloads/wxPython-4.0.0b2/bin/waf-1.7.15-p1 --wx_config=/local/data/fritz2/gmosby/Downloads/wxPython-4.0.0b2/build/wxbld/gtk3/wx-config --gtk3 --python="/local/data/fritz2/gmosby/my27project/bin/python" --out=build/waf/2.7/gtk3 configure build

Command '"/local/data/fritz2/gmosby/my27project/bin/python" /local/data/fritz2/gmosby/Downloads/wxPython-4.0.0b2/bin/waf-1.7.15-p1 --wx_config=/local/data/fritz2/gmosby/Downloads/wxPython-4.0.0b2/build/wxbld/gtk3/wx-config --gtk3 --python="/local/data/fritz2/gmosby/my27project/bin/python" --out=build/waf/2.7/gtk3 configure build ’ failed with exit code 1.

Finished command: build_py (1.197s)

When I examine the config.log (attached) I notice it’s failing when it is doing some linking for a test.cpp.1.o (line 90 in config.log). What stands out to me is that the -Wl,-rpath option is not followed by a directory name. I noticed in a previous post with a similar configuration error that the -Wl,-rpath options were not used in this test linking step, but that was a different OS.

Can anyone offer any leads?

Thanks,

G

config.log (30.7 KB)

Did you use the --enable-shared option when building Python? (And also the LDFLAGS -rpath setting mentioned there) IIRC, the last time I saw errors like this the problem was either the lack of the shared library, or unable to find it, or similar.

Also, you may have already installed everything you need, but for the record here is how I bootstrap a CentOS 7 vagrant box to prepare it for building wxPython: https://github.com/wxWidgets/Phoenix/blob/master/vagrant/centos-7/bootstrap.sh. The main thing to note is the use of the

centos7.iuscommunity.org packages to get non-standard versions of Python installed. I haven’t checked but they may have CentOS 6 support and ready-made Python 2.7 packages that you can install.

···

On Friday, January 19, 2018 at 1:45:23 PM UTC-8, Greg Mosby wrote:

Hi,

I’ve been trying to install wxPython on a Centos 6.9 machine this week. The first hurdle I had to jump was getting Python 2.7 installed on the system in a virtual environment as 2.7 was a requirement for this project. That was straightforward and installed with the instructions here: https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/

Robin Dunn

Software Craftsman

Thanks for the reply Robin. I checked the output of sysconfig.get_config_vars(‘Py_ENABLE_SHARED’) and sysconfig.get_config_vars(‘LDFLAGS’) and for the Python 2.7 I’m using and they both check out with what was done in the above Centos guide.

I did go ahead and see if there’s a Centos 6 IUS rpm, and there is. Using the bootstrap link as a reference, I did manage to install a few more packages, but there was no change in build results. It still fails when it’s trying to run the link on line 90 in the config.log. It’s interesting because I’ve found (by hand) that line 90 compiles in the appropriate directory if I remove the destination-less ‘-Wl, -rpath’ option from that line so the compile command reads:

/usr/bin/g++ test.cpp.1.o -o /local/data/fritz2/gmosby/Downloads/wxPython-4.0.0b2/build/waf/2.7/gtk3/.conf_check_96104c77ca554151fdca76e98067ec0d/testbuild/testprog -Wl,-Bstatic -Wl,-Bdynamic’ -L/usr/local/lib -lpython2.7

``


Let me know if you have anymore ideas. I’ll check back in if I get this resolved.

G

···

On Friday, January 19, 2018 at 5:15:02 PM UTC-5, Robin Dunn wrote:

On Friday, January 19, 2018 at 1:45:23 PM UTC-8, Greg Mosby wrote:

Hi,

I’ve been trying to install wxPython on a Centos 6.9 machine this week. The first hurdle I had to jump was getting Python 2.7 installed on the system in a virtual environment as 2.7 was a requirement for this project. That was straightforward and installed with the instructions here: https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/

Did you use the --enable-shared option when building Python? (And also the LDFLAGS -rpath setting mentioned there) IIRC, the last time I saw errors like this the problem was either the lack of the shared library, or unable to find it, or similar.

Also, you may have already installed everything you need, but for the record here is how I bootstrap a CentOS 7 vagrant box to prepare it for building wxPython: https://github.com/wxWidgets/Phoenix/blob/master/vagrant/centos-7/bootstrap.sh. The main thing to note is the use of the

centos7.iuscommunity.org packages to get non-standard versions of Python installed. I haven’t checked but they may have CentOS 6 support and ready-made Python 2.7 packages that you can install.

Robin Dunn

Software Craftsman

http://wxPython.org