LoginSignup
1
0

More than 3 years have passed since last update.

wxPythonをUbuntu20.04 on raspberry pi 4でビルド

Posted at

概要

ubuntu 20.04 on raspberry pi 4でとあるPythonアプリを動かそうとしたらwxが無いぞと怒られました。wxとは何だと思い調べるとwxPythonのことです。そこでwxPythonをインストールしました。

やったこと

pip本体は対応するパッケージが存在せず、wxPython本家サイトのソースコードからのビルドもうまく行かずでした。

このサイトで紹介されている方法が参考になりました。

紹介されている手法

$ pip install -U \
    -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 \
    wxPython

や、ubuntuバージョンを変えた

$ pip install -U \
    -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \
    wxPython

では途中でエラーでした。が、ここで使われているソースコードhttps://files.pythonhosted.org/packages/cb/4f/1e21d3c079c973ba862a18f3be73c2bbe2e6bc25c96d94df605b5cbb494d/wxPython-4.1.0.tar.gz
を自分でビルドしたら成功しました。

$ wget https://files.pythonhosted.org/packages/cb/4f/1e21d3c079c973ba862a18f3be73c2bbe2e6bc25c96d94df605b5cbb494d/wxPython-4.1.0.tar.gz
$ tar xvf wxPython-4.1.0.tar.gz
$ cd wxPython-4.1.0
$ python build.py etg sip build build_py
$ python build bdist_wheel
$ pip install dist/wxPython-4.1.1a1-cp36-cp36m-linux_aarch64.whl
$ python -c "import wx;print(wx.__version__)"
4.1.1a1
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0