Installing wxPython on Ubuntu 24

TravisCI is an Ubuntu 24.04 linux system
I installed the following dependencies

  • sudo apt install libnotify-dev
  • sudo apt install libgtk-3-dev
  • sudo apt-get install libtiff-dev
  • sudo apt-get install -y libsdl2-dev

But after it builds and I try to execute some wxPython code

I still get the following error

File “/home/travis/virtualenv/python3.12.4/lib/python3.12/site-packages/wx/init.py”, line 17, in
from wx.core import *
File “/home/travis/virtualenv/python3.12.4/lib/python3.12/site-packages/wx/core.py”, line 12, in
from ._core import *
ImportError: libtiff.so.6: cannot open shared object file: No such file or directory

Is this an obsolete dependency?

It seems like libtiff-dev should be pulling the runtime library in automatically, but try installing libtiff6 package and see if that resolves the issue.

I wound doing this to fix it:

ldconfig -p | grep libtiff
sudo ln -s /lib/x86_64-linux-gnu/libtiff.so.5 /lib/x86_64-linux-gnu/libtiff.so.6
sudo ldconfig -p | grep libtiff

Then I ran into this problem

ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32’ not found (required by /home/travis/virtualenv/python3.12.4/lib/python3.12/site-packages/wx/_core.cpython-312-x86_64-linux-gnu.so)

And I fixed it by doing this:

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install --only-upgrade libstdc++6

Now I am getting this error:

ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38’ not found (required by /home/circleci/project/venv/lib/python3.12/site-packages/wx/libwx_gtk3u_core-3.2.so.0)

I don’t think that’s going to work. It might “fix” the error but it is not going to work - generally library soname version changes like that are incompatible.

Are you sure this is really an Ubuntu 24.04 system? If so, it should have libtiff6.

Dang it !!!.

The CI environment was Jammy (Ubuntu 22.04). I was installing the 24.04 version of wxPython. Once I switched to Noble (Ubuntu 24.04), wxPython installed correctly and voila !!! no more errors.

Thanks for that “sanity” check

2 Likes

My sanity check bounces, too.

lol

in a venv bash do pip install wxpython