首先使用命令:
pip3 install wxpython
结果报错如下:
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5r281uk1/wxpython/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-8met5905/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-5r281uk1/wxpython/
然后通过查看github可知:
缺少一下依赖库,需要一一安装:
yum install -y dpkg-dev
yum install -y SDL SDL-devel
yum install -y build-essential
yum install -y python3.6-dev # use appropriate Python version here
yum install -y libjpeg-dev
yum install -y libtiff-dev
yum install -y libsdl1.2-dev
yum install -y gtk3 gtk3-devel
yum install -y libgstreamer-plugins-base0.