Installing wxPython on Ubuntu 12

Bumpy Stucko wrote:

I would like to install wxPython on Ubuntu 12.04. That version is not
supported, according to

InstallingOnUbuntuOrDebian - wxPyWiki

How should I proceed?

Any suggestions greatly appreciated.

Just use the wxPython packages from the Ubuntu repository instead. They have the latest 2.8 release already, so there hasn't been any need for putting packages at apt.wxwidgets.org too.

···

--
Robin Dunn
Software Craftsman

You should be which python are you trying to run, i.e. what do you
get when you type, in a terminal window:
and what happens when you type:
Again in a command window and complete with quotes.

···

On 17/04/13 16:46, Bumpy Stucko wrote:

  Thank you, but I don't find wxPython in the Ubuntu

repository, which is why I’m trying to find another way to install
it. I do find a number of related items: wxGlade (which I’ve
installed), pyprompter, Pyragua, GvRng, GNUmed, Cain (which I’ve
installed and want very much to run, but it balks, saying it needs
wxPython 2.8 or later) and PsychoPy.

  I suspect wxPython is already present,  but applications are not

aware of its presence. I find the following files on my system:

  /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wxPython

  /usr/lib/python2.7/dist-packages/wx-2.6-gtk2-unicode/wxPython

  /usr/include/wx-2.8/wx/wxPython

  /usr/share/pyshared/wx-2.8-gtk2-unicode/wxPython

  /usr/share/doc/wx2.8-examples/examples/wxPython



  Should I include one or more of these in one PATH or another?



  Again, thank you very much for your help.

python --version

python -c "import wx; print wx.version();"


Steve Gadget Barnes

Bumpy Stucko wrote:

Thank you, but I don't find wxPython in the Ubuntu repository, which is
why I'm trying to find another way to install it. I do find a number of
related items: wxGlade (which I've installed), pyprompter, Pyragua,
GvRng, GNUmed, Cain (which I've installed and want very much to run, but
it balks, saying it needs wxPython 2.8 or later) and PsychoPy.

I suspect wxPython is already present, but applications are not aware of
its presence. I find the following files on my system:

/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wxPython
/usr/lib/python2.7/dist-packages/wx-2.6-gtk2-unicode/wxPython
/usr/include/wx-2.8/wx/wxPython
/usr/share/pyshared/wx-2.8-gtk2-unicode/wxPython
/usr/share/doc/wx2.8-examples/examples/wxPython

Should I include one or more of these in one PATH or another?

Again, thank you very much for your help.

You have both 2.6 and 2.8 installed, and 2.6 is probably the default. If you don't need 2.6 for anything you can probably just uninstall its packages. (If anything does depend on it then the system will warn you about it.)

Otherwise you can change which is the default. You should be able to do that using ububntu's update-alternatives command. But I've been told that the ubuntu packages have broken that ability, I don't know if that has been solved since then or not. Another option might be to make sure that the 2.8 version of python-wxversion is installed, or just edit the wx.pth file yourself.

See: Redirecting to Google Groups

···

--
Robin Dunn
Software Craftsman

Sorry it’s taken me so long to get back to you, and many thanks for your responses so far, they have been very helpful.

Unfortunately I’m coming to realize how much I have to learn about package management in Linux, and Debian in particular. I’ve begun to probe the documentation of apt. The man page for dpkg contains a description of the process of installing a package, but prefaces it with a remark that the description is wholly inadequate. But I think that’s a basic question I need an answer to. Exactly what does it mean to say that a package has been “installed”? What files exist, what linkages exist, etc, which are necessary and sufficient to say that a package is “installed”? If the official documentation doesn’t say much more than that it doesn’t answer that question, then where is the answer to be found? If necessary, I’ll read the source code for apt, but I’d hope that wouldn’t be the shortest route to take.

I don’t want to burden you with the task of writing a full answer to that question, but perhaps you will be so kind as to point me to the right place to start learning.

···

I’ve searched my system for all files named wx.pth, and as far as I can tell, they all specify that version 2.8 should be used. Yet when I start up Python and enter “import wx” and then “help(wx)” it tells me that the file for version 2.6 has been used. Any idea why that could be happening?

Again, many thanks…

On Wednesday, April 17, 2013 11:44:14 AM UTC-5, Robin Dunn wrote:

Bumpy Stucko wrote:

Thank you, but I don’t find wxPython in the Ubuntu repository, which is

why I’m trying to find another way to install it. I do find a number of

related items: wxGlade (which I’ve installed), pyprompter, Pyragua,

GvRng, GNUmed, Cain (which I’ve installed and want very much to run, but

it balks, saying it needs wxPython 2.8 or later) and PsychoPy.

I suspect wxPython is already present, but applications are not aware of

its presence. I find the following files on my system:

/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wxPython

/usr/lib/python2.7/dist-packages/wx-2.6-gtk2-unicode/wxPython

/usr/include/wx-2.8/wx/wxPython

/usr/share/pyshared/wx-2.8-gtk2-unicode/wxPython

/usr/share/doc/wx2.8-examples/examples/wxPython

Should I include one or more of these in one PATH or another?

Again, thank you very much for your help.

You have both 2.6 and 2.8 installed, and 2.6 is probably the default.
If you don’t need 2.6 for anything you can probably just uninstall its
packages. (If anything does depend on it then the system will warn you
about it.)

Otherwise you can change which is the default. You should be able to do
that using ububntu’s update-alternatives command. But I’ve been told
that the ubuntu packages have broken that ability, I don’t know if that
has been solved since then or not. Another option might be to make sure
that the 2.8 version of python-wxversion is installed, or just edit the
wx.pth file yourself.

See:
https://groups.google.com/forum/?fromgroups=#!topic/wxpython-users/eQBq6dFnbmM


Robin Dunn

Software Craftsman

http://wxPython.org

The following may help, it was run on Ubuntu :
~$ python
Python 2.7.4 (default, Apr 19 2013, 18:28:01) [GCC 4.7.3] on linux2
Type “help”, “copyright”, “credits” or “license” for more
information.

import wx
wx.version()
’ (gtk2-unicode)’
wx.file
‘/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/init.pyc’
exit()
So now we know exactly which wx we are currently using:
$ ls -l /usr/lib/wx/python/
total 8
-rw-r–r-- 1 root root 19 Nov 16 16:43 wx2.8.pth
-rw-r–r-- 1 root root 19 Jan 12 16:34 wx2.8.pth.orig
lrwxrwxrwx 1 root root 24 Apr 5 01:34 wx.pth →
/etc/alternatives/wx.pth
Hmmm so wx.pth is a soft link to /etc/alternatives/wx.pth …
$ ls -l /etc/alternatives/w*
:
:
lrwxrwxrwx 1 root root 60 Apr 5 01:25 /etc/alternatives/wx-config
→ /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-release-2.8
lrwxrwxrwx 1 root root 28 Apr 5 01:34 /etc/alternatives/wx.pth
→ /usr/lib/wx/python/wx2.8.pth
So we are linked back to /usr/lib/wx/python/wx2.8.pth which we know
is an ordinary file:
$ cat /usr/lib/wx/python/wx2.8.pth
wx-2.8-gtk2-unicode
No so helpful but lets take a look at wx-config - a cat of
/usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-release-2.8 gives a
long script.
Now a little while back I downloaded and built wxPython 2.9.4.0,
(plus a patch), applied the patch and built the lot but didn’t run
sudo make install as I need to stick with 2.8.12.1 for work at the
moment but given that I downloaded to
~/Downloads/wxPython-src-2.9.4.0 I can use:
$ export PYTHONPATH=~/Downloads/wxPython-src-2.9.4.0/wxPython
$ export
LD_LIBRARY_PATH=~/Downloads/wxPython-src-2.9.4.0/wxPython/wxpy-bld/lib/
$ python
Python 2.7.4 (default, Apr 19 2013, 18:28:01) [GCC 4.7.3] on linux2
Type “help”, “copyright”, “credits” or “license” for more
information.
import wx
wx.version()
‘2.9.4.0 gtk2 (classic)’
exit()
Yippee!

···

On 04/05/13 01:10, Bumpy Stucko wrote:

  Sorry it's taken me so long to get back to you, and

many thanks for your responses so far, they have been very
helpful.

  Unfortunately I'm coming to realize how much I have to learn about

package management in Linux, and Debian in particular. I’ve
begun to probe the documentation of apt. The man page for dpkg
contains a description of the process of installing a package, but
prefaces it with a remark that the description is wholly
inadequate. But I think that’s a basic question I need an
answer to. Exactly what does it mean to say that a package has
been “installed”? What files exist, what linkages exist, etc,
which are necessary and sufficient to say that a package is
“installed”? If the official documentation doesn’t say much more
than that it doesn’t answer that question, then where is the
answer to be found? If necessary, I’ll read the source code for
apt, but I’d hope that wouldn’t be the shortest route to take.

  I don't want to burden you with the task of writing a full answer

to that question, but perhaps you will be so kind as to point me
to the right place to start learning.

  ***



  I've searched my system for all files named wx.pth, and as far as

I can tell, they all specify that version 2.8 should be used. Yet
when I start up Python and enter “import wx” and then “help(wx)”
it tells me that the file for version 2.6 has been used. Any idea
why that could be happening?

  Again, many thanks...


Steve Gadget Barnes

Many thanks, this looks very useful at a glance, will dig deeper…

···

On Saturday, May 4, 2013 1:57:38 AM UTC-5, Gadget Steve wrote:

On 04/05/13 01:10, Bumpy Stucko wrote:

  Sorry it's taken me so long to get back to you, and

many thanks for your responses so far, they have been very
helpful.

  Unfortunately I'm coming to realize how much I have to learn about

package management in Linux, and Debian in particular. I’ve
begun to probe the documentation of apt. The man page for dpkg
contains a description of the process of installing a package, but
prefaces it with a remark that the description is wholly
inadequate. But I think that’s a basic question I need an
answer to. Exactly what does it mean to say that a package has
been “installed”? What files exist, what linkages exist, etc,
which are necessary and sufficient to say that a package is
“installed”? If the official documentation doesn’t say much more
than that it doesn’t answer that question, then where is the
answer to be found? If necessary, I’ll read the source code for
apt, but I’d hope that wouldn’t be the shortest route to take.

  I don't want to burden you with the task of writing a full answer

to that question, but perhaps you will be so kind as to point me
to the right place to start learning.

  ***



  I've searched my system for all files named wx.pth, and as far as

I can tell, they all specify that version 2.8 should be used. Yet
when I start up Python and enter “import wx” and then “help(wx)”
it tells me that the file for version 2.6 has been used. Any idea
why that could be happening?

  Again, many thanks...


Steve Gadget Barnes

The following may help, it was run on Ubuntu :

~$ python

Python 2.7.4 (default, Apr 19 2013, 18:28:01)

[GCC 4.7.3] on linux2

Type "help", "copyright", "credits" or "license" for more

information.

>>> import wx

>>> wx.version()

' (gtk2-unicode)'

>>> wx.__file__

‘/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/init.pyc’

>>> exit()

So now we know exactly which wx we are currently using:

$ ls -l /usr/lib/wx/python/

total 8

-rw-r--r-- 1 root root 19 Nov 16 16:43 wx2.8.pth

-rw-r--r-- 1 root root 19 Jan 12 16:34 wx2.8.pth.orig

lrwxrwxrwx 1 root root 24 Apr  5 01:34 wx.pth ->

/etc/alternatives/wx.pth

Hmmm so wx.pth is a soft link to /etc/alternatives/wx.pth ..



$ ls -l /etc/alternatives/w*

:

:

lrwxrwxrwx 1 root root 60 Apr  5 01:25 /etc/alternatives/wx-config

→ /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-release-2.8

lrwxrwxrwx 1 root root 28 Apr  5 01:34 /etc/alternatives/wx.pth

→ /usr/lib/wx/python/wx2.8.pth

So we are linked back to /usr/lib/wx/python/wx2.8.pth which we know

is an ordinary file:

$ cat /usr/lib/wx/python/wx2.8.pth

wx-2.8-gtk2-unicode



No so helpful but lets take a look at wx-config - a cat of

/usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-release-2. 8 gives a
long script.

Now a little while back I downloaded and built wxPython 2.9.4.0,

(plus a patch), applied the patch and built the lot but didn’t run
sudo make install as I need to stick with 2.8.12.1 for work at the
moment but given that I downloaded to
~/Downloads/wxPython-src-2.9.4.0 I can use:

$ export PYTHONPATH=~/Downloads/wxPython-src-2.9.4.0/wxPython

$ export

LD_LIBRARY_PATH=~/Downloads/wxPython-src-2.9.4.0/wxPython/wxpy-bld/lib/

$ python

Python 2.7.4 (default, Apr 19 2013, 18:28:01)

[GCC 4.7.3] on linux2

Type "help", "copyright", "credits" or "license" for more

information.

>>> import wx

>>> wx.version()

'2.9.4.0 gtk2 (classic)'

>>> exit()



Yippee!