I am having trouble while using wxPython to build an application. After restarting my system (Ubuntu 22.04) suddenly my application would not work anymore (it did not throw this error prior to restarting) and gives me this Error Message:
Traceback (most recent call last):
File "/gui.py", line 1, in <module>
import wx
File "/.venv/lib/python3.11/site-packages/wx/__init__.py", line 17, in <module>
from wx.core import *
File "/.venv/lib/python3.11/site-packages/wx/core.py", line 12, in <module>
from ._core import *
ImportError: libwx_gtk3u_core-3.2.so.0: cannot open shared object file: No such file or directory
I tried to search for an answer and found this thread, but the version number mentioned in the top ansdwer does not match mine, and I don't know how to install the right version. I tried sudo apt-get install libwx_gtk3u_core-3.2.so.0, but this did not work.
Thank you in advance.
EDIT After a lot of searching I found the error. When installing from pip it seemas, as wxpython tries to install some gtk version, which did not fit my system. I used
pip uninstall wxpython
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxpython
This did install the right version of gtk alongside wxpython for my system (Ubuntu 22.04)