wugology
wugology

Reputation: 193

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.

Upvotes: 2

Views: 22124

Answers (7)

Aryan
Aryan

Reputation: 391

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

Upvotes: 2

EntangledLoops
EntangledLoops

Reputation: 2156

All you need is:

sudo apt-get install python-wxgtk3.0

Upvotes: 1

RandomGuy
RandomGuy

Reputation: 427

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.

Upvotes: 1

dennisobrien
dennisobrien

Reputation: 1198

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.

Upvotes: 0

onerty
onerty

Reputation: 9

wxPython package is named "python-wxgtk2.8" for wxWidgets 2.8 Install it: sudo apt-get install python-wxgtk2.8

Upvotes: 0

Mike Driscoll
Mike Driscoll

Reputation: 33111

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:

Upvotes: 0

Muzaffar
Muzaffar

Reputation: 101

Try installing python-wxglade.It must have all necessary wx modules inside.

Upvotes: 0

Related Questions