Unable to install wxPython in CentOS

Hi,
I am trying to install wxPython with following command after downloading the tar file

pip wheel -v wxPython-4.0.6.tar.gz 2>&1 | tee build.log

But following error comes

checking for GTK+ - version >= 3.0.0… no
*** Could not run GTK+ test program, checking why…
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
configure: error:
The development files for GTK+ were not found. For GTK+ 2, please
ensure that pkg-config is in the path and that gtk±2.0.pc is
installed. For GTK+ 1.2 please check that gtk-config is in the path,
and that the version is 1.2.3 or above. Also check that the
libraries returned by ‘pkg-config gtk±2.0 --libs’ or ‘gtk-config
–libs’ are in the LD_LIBRARY_PATH or equivalent.


Then I executed following command;
echo $PKG_CONFIG_PATH
Output: /opt/rh/rh-python36/root/usr/lib64/pkgconfig

And Gtk library files are not a=in the above path so I executed following command

$ gtk-config --libs
-L/usr/lib64 -lgtk -lgdk -rdynamic -lgmodule -ldl -lglib -lXi -lXext -lX11 -lm

Then, I copied gtk directories from /usr/lib64 to /opt/rh/rh-python36/root/usr/lib64/pkgconfig

But the problem is not solved yet.

Kindly help me through this.

Thanks in advance.
Ponoop

Try doing it like this:

WXPYTHON_BUILD_ARGS=--gtk2  pip wheel -v wxPython-4.0.6.tar.gz 

Thank you Robin for the response.
I tried with following set of commands and it worked for me.

$ yum -y install epel-release
$ yum -y update

After updating, I executed following commands.

$ yum groupinstall “Development Tools”
$ yum install ncurses-devel zlib-devel texinfo gtk±devel gtk2-devel qt-devel tcl-devel tk-devel kernel-headers kernel-devel
$ yum install gtk3-devel

Finally,
$ pip wheel -v wxPython-4.0.6.tar.gz 2>&1 | tee build.log
$ pip install wxPython-4.0.6-cp36-cp36m-linux_x86_64.whl

Although it worked for me, I don’t know if all the above steps are required or not. (Problem Solved)

Thanks again.