Debian arm系统安装wxPython

一、系统版本

二、安装wxPython-4.0.4.tar.gz

1、下载依赖

>sudo apt update
>sudo apt-get install build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libssl-dev libcurl4-openssl-dev libgstreamer-plugins-base1.0-dev libnotify-dev freeglut3 freeglut3-dev libtiff-dev -y

2、安装wxPython

下载 wxPython-404 源代码,解压,进入解压目录:

构建python包:>python3 build.py build

安装:>sudo python3 build.py install

三、打成whl

(1)安装wheel

>pip install wheel

(2)打包

>python3 setup.py bdist_wheel

最终生成/home/wxPython-4.2.1/dist/wxPython-4.2.1-cp37-cp37m-linux_aarch64.whl

四、常见问题

1、debian自带python3.7.3可以源码安装wxPython,但使用源码安装的python无法源码安装wxPython,只能使用whl。

报错如下:

源码安装python版本wxPython版本报错
3.64.0.4

ERROR: failed building wxWidgets
Traceback (most recent call last):
  File "build.py", line 1321, in cmd_build_wx
    wxbuild.main(wxDir(), build_options)
  File "/home/wxPython-4.0.4/buildtools/build_wxwidgets.py", line 375, in main
    "Error running configure")
  File "/home/wxPython-4.0.4/buildtools/build_wxwidgets.py", line 85, in exitIfError
    raise builder.BuildError(msg)
buildtools.builder.BuildError: Error running configure

---缺少依赖libtiff-dev

3.64.0.4Command '"/usr/local/bin/python3" /home/wxPython-4.0.4/bin/waf-2.0.8 --wx_config=/home/wxPython-4.0.4/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/local/bin/python3" --out=build/waf/3.6/gtk3 configure build ' failed with exit code 1.
3.64.1.0The configuration failed
(complete log in /home/wxPython-4.1.0/build/waf/3.6/gtk3/config.log)
3.64.2.0Traceback (most recent call last):
  File "build.py", line 44, in <module>
    from buildtools.config  import Config, msg, opj, posixjoin, loadETG, etg2sip, findCmd, \
  File "/home/wxPython-4.2.0/buildtools/config.py", line 30, in <module>
    from attrdict import AttrDict
ModuleNotFoundError: No module named 'attrdict'
3.64.2.1The python version is too old, expecting (3, 7, 0)
(complete log in /home/wxPython-4.2.1/build/waf/3.6/gtk3/config.log)

2、系统自带python3.7安装wxpython-4.0.4或者wxpython-4.0.7,需要libtiff-dev包,否则报错:

ERROR: failed building wxWidgets
Traceback (most recent call last):
  File "build.py", line 1321, in cmd_build_wx
    wxbuild.main(wxDir(), build_options)
  File "/home/wxPython-4.0.4/buildtools/build_wxwidgets.py", line 375, in main
    "Error running configure")
  File "/home/wxPython-4.0.4/buildtools/build_wxwidgets.py", line 85, in exitIfError
    raise builder.BuildError(msg)
buildtools.builder.BuildError: Error running configure
Finished command: build_wx (0m8.583s)
Finished command: build (0m8.583s)

但安装wxPython-4.1.0,不需要这个包。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值