problem with import from psychopy locale_setup

591 views
Skip to first unread message

Steve Genco

unread,
May 20, 2016, 6:41:07 AM5/20/16
to psychopy-dev
I just got psychopy to run in the latest Anaconda distribution, 4.0.0. It was a painful process as I had to manually add several of the supporting packages (pyo, wx ...), but I finally got it all working and updated to psychopy 1.83.04. However, now when I try to run an experiment, I get an error on this command in the generated py code:

from psychopy import locale_setup, visual, core, data, event, logging, sound, gui

The output I get is this:

##### Running: C:\<...>\Dropbox\python\PsychoPy\stroop\stroop_lastrun.py #####
pyo version 0.8.0 (uses single precision)
Traceback (most recent call last):
  File "C:\<...>\Dropbox\python\PsychoPy\stroop\stroop_lastrun.py", line 11, in <module>
    from psychopy import locale_setup, visual, core, data, event, logging, sound, gui
ImportError: cannot import name locale_setup

If I just delete 'locale_setup' from the import list, the script runs fine. Ironically, I have no need for the module as I am only using the Windows version of PsychoPy.

'locale_setup.py' and 'locale-setup.pyc' appear to be right where they should be, in C:\Anaconda2\Lib\site-packages\psychopy-1.82.01.

Any ideas on how I can fix this, or short of that, just modify my copy of Psychopy to not include locale_setup in the import list?

Steve Genco

unread,
May 25, 2016, 3:54:37 PM5/25/16
to psychopy-dev
I uninstalled the Anaconda distribution and reinstalled the PDL Distribution that includes psychopy. The problem disappeared. Please disregard.

Jon Peirce

unread,
May 25, 2016, 4:30:14 PM5/25/16
to psycho...@googlegroups.com

What's the PDL distribution? I've not heard of that

Glad your problem got sorted - I'm afraid I don't use anaconda or other such distributions so I can't help with those questions.

cheers
Jon

--
You received this message because you are subscribed to the Google Groups "psychopy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Jon Peirce
http://www.peirce.org.uk

David Feinberg

unread,
Sep 8, 2016, 11:48:56 AM9/8/16
to psychopy-dev
I don't think this is resolved.  I'm having the same error.  On fresh installs using ubuntu and windows, I get the same import error:


    from psychopy import locale_setup, visual, core, data, event, logging, sound, gui
ImportError: cannot import name locale_setup

I've removed the import to run the experiment, but I have no idea what effect this has on the experiment.

Jon

unread,
Sep 9, 2016, 4:57:23 AM9/9/16
to psychopy-dev


On Thursday, September 8, 2016 at 4:48:56 PM UTC+1, David Feinberg wrote:
I don't think this is resolved.  I'm having the same error.  On fresh installs using ubuntu and windows, I get the same import error:

    from psychopy import locale_setup, visual, core, data, event, logging, sound, gui
ImportError: cannot import name locale_setup

I've removed the import to run the experiment, but I have no idea what effect this has on the experiment.


locale_setup.py is definitely included in all the current distributions here:

So when you say "fresh install" what method of installing are you using? What version are you installing? For the ubuntu installation I suppose the neurodebian package might not have it included so we could check that.

Removing that import probably won't hurt you; it merely ensures that things like dialog boxes show up in the appropriate language (e.g. Japanese) so if you're already in US/UK English you probably won't notice.

cheers
Jon

John Allen

unread,
Feb 6, 2017, 7:30:13 AM2/6/17
to psychopy-dev
I had this too.

The problem turned out to be because I had a subfolder alongside my psyexp file that was called 'psychopy'

renaming it stopped the locale_setup error :-)

Hope Wells

unread,
Feb 27, 2017, 7:36:30 AM2/27/17
to psychopy-dev
Does anyone know how I can get the experiment to run with an error box appearing saying that it can't run because of a 'locale_setup' problem. Many thanks

Jonathan Peirce

unread,
Feb 27, 2017, 7:37:46 AM2/27/17
to psycho...@googlegroups.com

Do you have a folder called psychopy next to your experiment (or near it)? Call that folder something else.

--
You received this message because you are subscribed to the Google Groups "psychopy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Jonathan Peirce
http://www.peirce.org.uk


This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.
Reply all
Reply to author
Forward
0 new messages