psychopy.org | Reference | Downloads | Github

Installing - Dependencies - Problems with wxPython

Hi all,

I want to work with psychopy under ubuntu (xenial). I wanted to have a new version, hence I omitted apt-get and installed psychopy using pip (http://www.psychopy.org/installation.html - > Manual Installation). Some of the pip packages could not be installed, but non has done harm so far. I installed pythonwx and pyo from the apt repros.

I then tried to start psychopy builder. As psychopy does not seem to be in the path (which is not actually surprising) I tried to start the builder via dist-packages/psychopy/app/builder/builder.py.

However it complains:

ImportError: /usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/misc.x86_64-linux-gnu.so: symbol _ZTV21wxNotificationMessage, version WXU_3.0 not defined in file libwx_gtk2u_adv-3.0.so.0 with link time reference

Am I wrong trying to start the builder like this? Is wxpython broken? Any ideas?

Thanks!

Soraltan

Hi,

I typically start PsychoPy by running psychopy/app/psychopyApp.py. But I assume this wouldn’t work for you either, as something with your installation apparently needs fixing.

I usually don’t use system-wide Python installations, but rather install the Anaconda Python 2.7 distro on a per-user basis. This has worked very well for me on Windows, macOS, and Linux so far. Maybe you can try that approach? :slight_smile:

There are a lot of things to be said about this. Firstly, just note that it seems to be either a problem with wxpython, or the package in the Ubuntu repos is out of date.

So you said you installed wxPython from the repos, so since you are on 16.04 I assume you have python-wxgtk3.0 ? What’s you’re output for these two commands?:

sudo dpkg --get-selections | grep  python-wk

That should give you the name of the package you have installed. Then just for the record to show what version it is run:

sudo apt-cache policy <packageName>

So a little googling turned up that this bug (or if not this one a very similar one) was fixed a couple of years ago, at least for some version of the software:
https://bugs.archlinux.org/task/38473

The question is if the repos are up to date. If the repos have the broken version a bug report should be filed.

Unfortunately, wxpython is apparently not doing so great in the documentation department. This page about using the ppa is really out of date.

https://wiki.wxpython.org/InstallingOnUbuntuOrDebian

That ppa is actually offline.

In lieu of installing something like anaconda, or reporting and waiting for a fix, I see three ways forward, each with their own caveats. For all of these you should first uninstall python-wxgtk3.0 (I’m assuming that’s what you have):

You could try downgrading to python-wxgtk2.8 (I think that’s the one before this version. I’m on Ubuntu 14.04 and that’s what was installed on my machine). I think you could install the deb file, downloading it from here (click on the right link for your architecture): http://packages.ubuntu.com/trusty/python-wxgtk2.8

sudo dpkg -i <debFile>

You might have to install some dependencies. Hopefully this doesn’t just create different problems.

Other than that maybe pip or installing from source? If it were me and it wasn’t an emergency, I would try to see if they could fix the bug, or if the repos are out of date, report it. Maybe start here for help:

Report a bug for the repos here: https://launchpad.net/distros/ubuntu/+source/wxpython3.0/+bugs

This is a forum for wx, they would probably know more: https://forums.wxwidgets.org/

1 Like

Hi,

thanks, for the suggestions. I have not tried Anaconda. Honestly,I never heard of it before. Need to look into it.

Regarding Danile’s suggestions:

sudo dpkg --get-selections | grep  python-wx
python-wxgtk3.0                                 install
python-wxversion                                install

So, yes I have pythonwx3.0.

sudo apt-cache policy python-wxgtk3.0
python-wxgtk3.0:
  Installiert:           3.0.2.0+dfsg-1build1
  Installationskandidat: 3.0.2.0+dfsg-1build1
  Versionstabelle:
 *** 3.0.2.0+dfsg-1build1 500
        500 http://de.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status

and

sudo apt-cache policy python-wxversion
python-wxversion:
  Installiert:           3.0.2.0+dfsg-1build1
  Installationskandidat: 3.0.2.0+dfsg-1build1
  Versionstabelle:
 *** 3.0.2.0+dfsg-1build1 500
        500 http://de.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://de.archive.ubuntu.com/ubuntu xenial/universe i386 Packages
        100 /var/lib/dpkg/status

I noticed the ppa is no longer available and even if it was: The latest ubuntu version supported was maverick, if I recall correctly.

I did not know it was possible to install packages of another ubuntu version using dpkg. I kind of assumed dpkg would notice and not do it.

Since I urgently needed Psychopy I just installed the apt-version last night. But I generally would prefer a newer version. As soon as I have my hands free again (somewhen next week) I will try your suggestions (Anaconda and installing pythonwx2.8 manually).

I’m in doubt about reporting this as a bug. Is it certain, it is really a problem in the pythonwx3.0 package? Or maybe the conjunction of software installed with pip (psychopy) and with apt (pythonwx) yielded some strange effects?

Thanks again. Bye

Soraltan

My guess would be that it is indeed a bug, based on the error (looks like something was either not installed or not defined), and because there was a bug nearly exactly like it reported and fixed (in the arch link above).

I would think the wx people would know more since they make and use that software. What I’m trying to say is I think the wx forums or an Ubuntu forum would be a more fruitful place to seek guidance. Not to mean you shouldn’t post here :slight_smile:

1 Like

You could install psychopy using package manager to get the dependencies all installed and then just remove the psychopy lib itself by deleting the files. Then do
pip install psychopy

If you can’t find the apt-get installed version of psychopy then open python and do

import psychopy
print(psychopy)

and its path should show up.

You can use the same method to install a development version. Clone the repository to some local folder where you can hack away, cd into that folder and do
python setup.py develop
(rather than setup.py install) and then the version of psychopy being imported will be this repository version instead of one installed in a site-packages location.