一、系统版本
二、安装wxPython-4.0.4.tar.gz
>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
下载 wxPython-404 源代码,解压,进入解压目录:
构建python包:>python3 build.py build
安装:>sudo python3 build.py install
三、打成whl
(1)安装wheel
(2)打包
最终生成/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.6 | 4.0.4 |
ERROR: failed building wxWidgets |
3.6 | 4.0.4 | Command ‘”/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.6 | 4.1.0 | The configuration failed (complete log in /home/wxPython-4.1.0/build/waf/3.6/gtk3/config.log) |
3.6 | 4.2.0 | Traceback (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.6 | 4.2.1 | The 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,不需要这个包。
原文地址:https://blog.csdn.net/weixin_40459875/article/details/134623764
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_27524.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!