简体   繁体   中英

Installing wxpython on ubuntu 14.04

When I try to open PlayOnLinux from the commandline, I get this error:

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. Unfortunately, the entire wxpython wiki website currently says "wxPyWiki is down for troubleshooting" right now.

I found this StackOverflow question, which is basically the same as mine. I tried all the lower-voted comments, and they all appear to work, but import wx still fails. When I tried the top-rated comment in that thread, I got to step 7 successfully, but then it says

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.

EDIT: sudo pip install wxPython tells me it's already installed ("Requirement already satisfied") and suggests I use --upgrade . It's not installed, import wx still fails.

EDIT: sudo apt-get install wxpython gives the error 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.

EDIT: I tried uninstalling and reinstalling playonlinux and python-wxversion. Both remove/install appeared successful, but I still get the same No module named wxversion error.

EDIT: I tried the solutions posted here (except for reinstalling the OS). They did not work. I'd rather not reinstall Ubuntu.

The answer about installing "python-wxgtk2.8" is correct. 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 . I have done that, and have wx 3.0 installed.

所有你需要的是:

sudo apt-get install python-wxgtk3.0

Before that install 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

$ 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. If you are using Windows or macOS

$ pip install -U wxpython

If you are using 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. 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:

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:

$ 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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