psychopy.app localization error on startup

222 views
Skip to first unread message

Hrvoje Stojic

unread,
Jul 12, 2015, 5:39:36 PM7/12/15
to psychop...@googlegroups.com
Hi all,

I reinstalled my OS and psychopy recently and now I tried running an experiment in Psychopy and I get the following error on either running psychopy directly from terminal or trying to run experiment file with python

Traceback (most recent call last):
  File "/usr/bin/psychopy", line 48, in <module>
    app = PsychoPyApp(0, showSplash=showSplash)
  File "/usr/lib/pymodules/python2.7/psychopy/app/_psychopyApp.py", line 76, in __init__
    self.onInit(**kwargs)
  File "/usr/lib/pymodules/python2.7/psychopy/app/_psychopyApp.py", line 90, in onInit
    from psychopy.app import localization  # needed by splash screen
ImportError: cannot import name localization

it seems there is something off with my locale settings, I tried installing some new locales but it didnt help, I am googling already for few hours trying to figure out what is going on, can anyone shed some light?

psychopy version: 1.81.03

output from locale command:

LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=es_ES.UTF-8
LC_TIME=es_ES.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=es_ES.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=es_ES.UTF-8
LC_NAME=es_ES.UTF-8
LC_ADDRESS=es_ES.UTF-8
LC_TELEPHONE=es_ES.UTF-8
LC_MEASUREMENT=es_ES.UTF-8
LC_IDENTIFICATION=es_ES.UTF-8
LC_ALL=

and output from locale -a
C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
es_AR.utf8
es_BO.utf8
es_CL.utf8
es_CO.utf8
es_CR.utf8
es_CU
es_CU.utf8
es_DO.utf8
es_EC.utf8
es_ES.utf8
es_GT.utf8
es_HN.utf8
es_MX.utf8
es_NI.utf8
es_PA.utf8
es_PE.utf8
es_PR.utf8
es_PY.utf8
es_SV.utf8
es_US.utf8
es_UY.utf8
es_VE.utf8
POSIX


Jeremy Gray

unread,
Jul 15, 2015, 10:36:23 AM7/15/15
to psychop...@googlegroups.com
Hi Hrvoje,

That line of code should work ("from psychopy.app import localization"), or at least should not give that error message when starting PsychoPy. Not sure what could have happened, but you might try removing then reinstalling PsychoPy for a second time.

If you run an experiment file from python, doing so should not start PsychoPy (the application). So I am confused about your meaning when you say you get the error when trying to run an experiment file with python.

Also, if you load that same experiment in the Coder view and run it from there, does that work? If not, what error message?

If you open PsychoPy, and in the preferences set the locale to English or Spanish, does that help at all? I am guessing that you can't start the app at all, so won't be able to change the preferences this way.

--Jeremy


--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/0d72277f-fbb9-499b-b08a-41208ff32241%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hrvoje Stojic

unread,
Jul 15, 2015, 7:57:09 PM7/15/15
to psychop...@googlegroups.com
Hi Jeremy,

thanks for the interest. I tried reinstalling Psychopy but it didn't help, same error message appears.

The error appears if I try starting the psychopy from the terminal:
$ psychopy

or if I tr to start my experiment file mainScript.py from terminal, although here the Traceback is slightly different:
$ python mainScript.py

Traceback (most recent call last):
  File "mainScript.py", line 12, in <module>
    from psychopy import visual, core, gui, event, data
  File "/usr/lib/pymodules/python2.7/psychopy/gui.py", line 11, in <module>
    from psychopy.app import localization
ImportError: cannot import name localization


Trying to start psychopy from the GUI doesn't work at all, i.e. I cannot get to the coder/builder view or to set the preferences from psychopy app.

Hrvoje

Hrvoje Stojic

unread,
Jul 15, 2015, 8:00:38 PM7/15/15
to psychop...@googlegroups.com
I also took a look at the dependencies, and only thing that seemed a bit different is that I also have wx version 3.0 installed in my python.

On my old ubuntu distro everything worked without issues, this occurred after I installed newest version (L)Ubuntu 15.04.

Hrvoje

pumpkinhead

unread,
Oct 1, 2015, 9:17:51 AM10/1/15
to psychopy-users
Hi,
I have the same problem on a RaspberryPi 2 with raspian (Debian) and psychopy 1.82.01.
An old version of PsychoPy 1.73 GUI did run but experiments did not start. Then I updated to 1.82.01 and now neither experiments nor the GUI will start.
All end up with the same localization import error as reportet bei Hrvoje Stojic.
Anything new on this issue?
Thanks,
Torsten

Torsten

unread,
Oct 1, 2015, 10:42:45 AM10/1/15
to psychopy-users
Hi again,
The problem is somehow related to the wx - localization stuff.
If I remove all _translate() commands, then ... okay I do not know whether it works but the error message moves on to the next file with a _translate() command.

Is there something related to python-wx... that needs to be installed to make the localization work that is not installed automatically?
Thanks,
Torsten
Reply all
Reply to author
Forward
0 new messages