Ubuntu 18.04 wxPython安装报错:ERROR: failed building wxWidgets

pip安装wxPython:

pip install -U wxPython==4.0.7

报错:

 Error running configure
  ERROR: failed building wxWidgets
  Traceback (most recent call last):
    File "build.py", line 1468, in cmd_build_wx
      wxbuild.main(wxDir(), build_options)
    File "/tmp/pip-install-8_i22mue/wxpython_1dca4dfcf7a746f6a2814ed2001d3b45/buildtools/build_wxwidgets.py", line 373, in main
      "Error running configure")
    File "/tmp/pip-install-8_i22mue/wxpython_1dca4dfcf7a746f6a2814ed2001d3b45/buildtools/build_wxwidgets.py", line 85, in exitIfError
      raise builder.BuildError(msg)
  buildtools.builder.BuildError: Error running configure
  Finished command: build_wx (0m3.443s)
  Finished command: build (0m3.443s)
  Command '"/home/zijiesun/anaconda3/envs/DLC2/bin/python" -u build.py build' failed with exit code 1.
  ----------------------------------------
  ERROR: Failed building wheel for wxPython

解决方法:
wxPython包库找到自己需要的版本,进入该文件夹,笔者系统为ubuntu18.04,所以进入该目录,选择对于版本的wxPython whl文件下载,例如,笔者系统为linux,python3.7,所以选择:
在这里插入图片描述
下载后,cd进入whl包所在路径:

pip install wxPython-4.0.7-cp37-cp37m-linux_x86_64.whl

安装成功:

Processing ./wxPython-4.0.7-cp37-cp37m-linux_x86_64.whl
Requirement already satisfied: six in /home/zijiesun/anaconda3/envs/DLC2/lib/python3.7/site-packages (from wxPython==4.0.7) (1.15.0)
Requirement already satisfied: numpy in /home/zijiesun/anaconda3/envs/DLC2/lib/python3.7/site-packages (from wxPython==4.0.7) (1.16.4)
Requirement already satisfied: pillow in /home/zijiesun/anaconda3/envs/DLC2/lib/python3.7/site-packages (from wxPython==4.0.7) (8.0.1)
Installing collected packages: wxPython
Successfully installed wxPython-4.0.7

参考:

- [1] (blog) https://blog.csdn.net/weixin_38608322/article/details/105542530
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值