Raspberry Pi

Build wxPython On Raspberry Pi Bookworm

set pyenv to your python version:

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install <your python version>

example: env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.10.16

switch to your project directory:

cd ~/<Project>

pyenv local 3.10.16

First update these following Package for you PI:

sudo apt install python3-dev libgtk2.0-dev libgtkd-3-dev

sudo apt install python3-wxgtk4.0 wxglade python-wxtools
sudo apt install dpkg-dev build-essential libjpeg-dev libtiff-dev libsdl2-gfx-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev libgstreamer-plugins-base1.0-dev libnotify-dev freeglut3-dev libwebkitgtk-6.0-dev libghc-gtk3-dev libwxgtk3.2-dev libwxgtk-gl3.2-1 ibwebkit2gtk-4.0-dev

create virtualenv with pipenv:

python3 -m pipenv --python 3.10.16 shell

Start Build wxPython in your PI:

python3 -m pip download wxpython==4.2.1

tar xf wxPython-4.2.1.tar.gz

start build process in wxPython-4.2.1 folder:

cd wxPython-4.2.1

python3 -m pip install -r requirements.txt

python3 build.py build bdist_wheel --jobs=2 

Created .whl file is in ~/wxPython-4.2.2/dist/

Error on Rasbian (Rasberry pi 4):

demo-02) andie@raspi-dev02:~/projects/demo-02/wxPython-4.2.2/dist $ python3

Python 3.10.16 (main, Apr 20 2025, 09:26:24) [GCC 12.2.0] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import wx

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "..../.local/share/virtualenvs/demo-02-Sja4vUcv/lib/python3.10/site-packages/wx/__init__.py", line 17, in <module>

    from wx.core import *

  File "..../.local/share/virtualenvs/demo-02-Sja4vUcv/lib/python3.10/site-packages/wx/core.py", line 12, in <module>

    from ._core import *

ImportError: ..../.local/share/virtualenvs/demo-02-Sja4vUcv/lib/python3.10/site-packages/wx/_core.cpython-310-aarch64-linux-gnu.so: undefined symbol: _ZN13wxRadioButtonD2Ev, version WXU_3.2

Ref:

Eine Antwort schreiben

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

error: Content is protected !!