Install wxPython 4.0.3 for Python 3.6 on Debian Jessie

551 views
Skip to first unread message

Brendan Simon (eTRIX)

unread,
Oct 30, 2018, 7:40:55 PM10/30/18
to wxPython-users
I'm trying to install wxPython 4.0.3 with Python 3.6 on Debian 8 Jessie.

`pip3.6 install wxPython` fails to configure.  I'm in process of trying to install build dependencies to get it to configure and build, but so far not much luck.

I looked at `https://extras.wxpython.org/wxPython4/extras/linux/gtk3/debian-8/` and found there are no builds for Python 3.6 -- nor for Debian 9 Stretch.  Understandable as Python 3.6 is only available in Debian 10 Buster (still in testing).

I found the Ubuntu wheels and installed them and it succeeded :)

`https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04/wxPython-4.0.3-cp36-cp36m-linux_x86_64.whl`

Ubuntu 14.04 is based on Debian Jessie so it might just work .... nope :(

# python3.6 -c 'import wx'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/usr/local/lib/python3.6/site-packages/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory

A search of `/usr/local` shows I have static libraries and not shared libraries.  Is this normal?

# find /usr/local -name 'libpython*'
/usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a
/usr/local/lib/libpython3.6m.a

Is there anyway to resolve this so I can get wxPython 4.0.3 working on Debian Jessie?  Either direct `pip install wxPython` or specifying one of the linux wheels.

Thanks, Brendan.

Brendan Simon (eTRIX)

unread,
Oct 30, 2018, 9:15:19 PM10/30/18
to wxPython-users
The python3.6 install on Jessie was manually built from sources.  I needed to configure with `--enable-shared` to get the shared libraries (who knew !!)

Unfortunately, the ubuntu wheel must be linked against libjpeg8 (give the following error).

$ python3.6 -c 'import wx'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/usr/local/lib/python3.6/site-packages/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: libjpeg.so.8: cannot open shared object file: No such file or directory

I'm not sure if there's much I can do about that.  libjpeg8 is only available in Debian Sid.

Any thoughts on how to install wxPython 4 on Debian Jessie with Python 3.6 ??

Thanks, Brendan.

Robin Dunn

unread,
Oct 31, 2018, 11:31:38 AM10/31/18
to wxPython-users
Or, you could do it the easy way:

Brendan Simon

unread,
Oct 31, 2018, 7:03:54 PM10/31/18
to wxPython-users
I'm all in favour of the easy way :-)

Are you saying this will build/install for Python 3.6 ?  I only see Python 3.4 wheels at that URL.

Brendan.

Robin Dunn

unread,
Oct 31, 2018, 8:26:19 PM10/31/18
to wxPython-users
Oops, yes you're right. Sorry. I didn't pay close enough attention to what version you were using, and probably would have forgotten that newer Pythons were not available in that version of Debian even if I had. :-)

You can use the details in this script to ensure you have the correct dev packages installed: https://github.com/wxWidgets/Phoenix/blob/wxPy-4.0.x/vagrant/debian-8/bootstrap.sh. Once those are all available then building with pip or from the source tarball should succeed. And yes, as you've discovered already, it does require that the Python used was configured and built with --enable-shared.

--Robin
Reply all
Reply to author
Forward
0 new messages