wxWidgets 是一个跨平台的GUI库, 它的Python2扩展叫做 wxPython. Python3 扩展叫做 Phoenix.

本文介绍如何在 Python3 的环境中用 PIP 和 源码编译 方式安装 Phoenix

一行命令在Python3中装好Phoenix

> sudo python3.4 -m pip install –upgrade –pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython -b /mnt/disk/pip_build

> # wxPython Phoenix
> sudo -H python3 -m pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython

用源码安装

源码安装 Python3.6

由于目前的 Tensorflow 不支持最新的 3.7 那我们就选 3.6 做为编译平台吧

> sudo apt install openssl bzip2 expat python-gdbm libreadline6-dev
> sudo apt-get install -y gcc make build-essential  wget curl llvm \
		libssl-dev zlib1g-dev libbz2-dev xz-utils liblzma-dev \
		libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev \
		tk-dev libffi-dev libgdbm-dev libdb5.3-dev libexpat1-dev uuid-dev
> ./configure --enable-shared --enable-optimizations
> make -j32
> sudo make altinstall
> sudo ln -s /usr/local/bin/python3.6 /usr/local/bin/python3

源码安装 wxPython Phoenix

> # 安装依赖库
> apt-get install -y libgtk2.0-dev libgtk-3-dev \
	libgl1-mesa-dev libglew-dev libglm-dev \
	libjpeg-dev libtiff-dev \
	libsdl2-dev libsdl2-image-dev libgstreamer-plugins-base0.10-dev \
	libnotify-dev freeglut3 freeglut3-dev libsm-dev \
	libwebkitgtk-dev libwebkitgtk-3.0-dev \
	libwaffle-dev
> python3 build.py dox etg --nodoc sig build --release --build_dir=/mnt/disk/wx_build -j32
> sudo -H python3 build.py install --build_dir=/mnt/disk/wx_build

支付宝打赏 微信打赏

您的打赏是对我最大的鼓励!

linzhanyu


Linux, VIM, OpenGL, OpenCL.

Python, C++, C#, ML.

相看莫相笑,同是竹林人。