简体   繁体   English

在Ubuntu 14.04上安装wxpython

[英]Installing wxpython on ubuntu 14.04

When I try to open PlayOnLinux from the commandline, I get this error: 当我尝试从命令行打开PlayOnLinux时,出现以下错误:

Looking for python... 2.7.8 - selected
Traceback (most recent call last):
  File "mainwindow.py", line 31, in <module>
    import wxversion
ImportError: No module named wxversion

Nearly every forum post I have found has suggested I install wxPython, then links here or to some other wxpython wiki page. 我发现的几乎每个论坛帖子都建议我安装wxPython,然后在此处链接或链接到其他wxpython Wiki页面。 Unfortunately, the entire wxpython wiki website currently says "wxPyWiki is down for troubleshooting" right now. 不幸的是,整个wxpython Wiki网站当前都说“ wxPyWiki已停止进行故障排除”。

I found this StackOverflow question, which is basically the same as mine. 我发现了这个StackOverflow问题,该问题与我的问题基本相同。 I tried all the lower-voted comments, and they all appear to work, but import wx still fails. 我尝试了所有投票率较低的评论,但它们似乎都可以使用,但是import wx仍然失败。 When I tried the top-rated comment in that thread, I got to step 7 successfully, but then it says 当我尝试在该线程中评价最高的评论时,我成功地进入了步骤7,但随后显示

In file included from scr/helpers.cpp:16:0:
include/wx/wxPython/wxPython_int.h:19:19: fatal error: wx/wx.h: No such file or directory
#include <wx/wx.h>

compilation terminated

If anyone has any suggestions for how I can properly install wxPython on Ubuntu, they would be greatly appreciated. 如果有人对我如何在Ubuntu上正确安装wxPython有任何建议,将不胜感激。

EDIT: sudo pip install wxPython tells me it's already installed ("Requirement already satisfied") and suggests I use --upgrade . 编辑: sudo pip install wxPython告诉我它已经安装(“需求已满足”),建议我使用--upgrade It's not installed, import wx still fails. 未安装, import wx仍然失败。

EDIT: sudo apt-get install wxpython gives the error Unable to locate package wxpython 编辑: sudo apt-get install wxpython给出错误Unable to locate package wxpython

EDIT: I tried sudo apt-get install python-wxglade and it appeared to work, but playonlinux still gives the same error and import wx still fails. 编辑:我尝试sudo apt-get install python-wxglade ,它似乎可以工作,但是playonlinux仍然给出相同的错误,并且import wx仍然失败。

EDIT: I tried uninstalling and reinstalling playonlinux and python-wxversion. 编辑:我尝试卸载并重新安装playonlinux和python-wxversion。 Both remove/install appeared successful, but I still get the same No module named wxversion error. 两次删除/安装都似乎成功,但是我仍然得到相同的No module named wxversion错误。

EDIT: I tried the solutions posted here (except for reinstalling the OS). 编辑:我尝试过这里发布的解决方案(重新安装操作系统除外)。 They did not work. 他们没有工作。 I'd rather not reinstall Ubuntu. 我宁愿不重新安装Ubuntu。

The answer about installing "python-wxgtk2.8" is correct. 关于安装“ python-wxgtk2.8”的答案是正确的。 But that's if you want to install 2.8, if you want 3.0 in 14.04, you can get it by following this post . 但这就是如果您想安装2.8,如果您想在14.04中安装3.0,则可以通过阅读这篇文章获得它。 I have done that, and have wx 3.0 installed. 我已经做到了,并安装了wx 3.0。

所有你需要的是:

sudo apt-get install python-wxgtk3.0

Before that install gtk3 在此之前安装gtk3

$ sudo apt-get install libgtk-3-dev

If you are facing problem to install wxpython on Python3 please use this command to install wxpython 如果您遇到在Python3上安装wxpython的问题,请使用此命令安装wxpython

$ pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython

By this command you can install latest wxPython4 version. 通过此命令,您可以安装最新的wxPython4版本。 If you are using Windows or macOS 如果您使用Windows或macOS

$ pip install -U wxpython

If you are using Anaconda/Conda 如果您正在使用Anaconda / Conda

$ conda install -C anaconda wxpython

尝试安装python-wxglade,其中必须包含所有必需的wx模块。

Check Synaptic for wxPython 3.x to see if you can install it that way. 检查Synaptic for wxPython 3.x,看看是否可以这种方式安装它。 According to https://www.playonlinux.com/en/news.html , version 4.2.5 of PlayOnLinux supports wxPython 3. If you can't get Synaptic to find a copy of wxPython 3, then you should refer to the official build instructions found here: 根据https://www.playonlinux.com/en/news.html,PlayOnLinux版本4.2.5支持wxPython3。如果您无法让Synaptic查找wxPython 3的副本,那么您应该参考官方的在此处找到构建说明:

wxPython软件包的名称为“ wxWidgets 2.8”的“ python-wxgtk2.8”。安装它: sudo apt-get install python-wxgtk2.8

I tried many things, so I'm not sure if this is the minimum set of pre-requisites. 我尝试了很多事情,所以我不确定这是否是前提条件的最低要求。

$ sudo apt-get install libwxbase3.0-dev libwxgtk3.0-dev wx-common libwebkit-dev libwxgtk-webview3.0-dev wx3.0-examples wx3.0-headers wx3.0-i18n libwxgtk-media3.0-dev

Then I pip installed the Phoenix version: 然后我点安装了Phoenix版本:

$ sudo pip install --upgrade --pre -f http://wxpython.org/Phoenix/snapshot-builds/ --trusted-host wxpython.org wxPython_Phoenix

This installs wxPython via pip, but I don't think it addresses your issue with wxversion . 这将通过pip安装wxPython,但我认为它无法解决wxversion的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM