Psychopy Demos not working

Do any of the psychopy demos work?

I’ve tried image_blocks both in demos and demos/Psychopy2 Demos - it displays the text “some houses” and “some faces” but doesn’t actually show any images. I’ve stepped through the generated python in a debugger and it looks like the image is being loaded via

image.setImage(stimFile)

and it looks like the window is being flipped via

win.flip()

I’m not an expert in graphics buffers and know very little about psychopy but this would kind of make sense.

But no images.

So I checked a couple of other demos at random - mental_ rotation and keyNameFinder - both of these crash out.

Here is the output from pyschopy

Running: /Users/gregor/Experiment/demos/images_blocks/blockedTrials_lastrun.py
0.1753 WARNING pyo audio lib was requested but not loaded: ImportError(‘No module named pyo’,)
4.8368 WARNING unknown type:participant
4.8370 WARNING unknown type:session
2017-11-29 07:22:58.967 Python[5391:58378] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/x7/q6twv9l503q92mwzhvj_zmwh0000gn/T/org.python.python.savedState

Running: /Users/gregor/Experiment/demos/PsychoPy2 Demos/images_blocks/blockedTrials_lastrun.py
0.4911 WARNING pyo audio lib was requested but not loaded: ImportError(‘No module named pyo’,)
6.6032 WARNING unknown type:participant
6.6033 WARNING unknown type:session
2017-11-29 20:58:08.702 Python[6465:111547] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/x7/q6twv9l503q92mwzhvj_zmwh0000gn/T/org.python.python.savedState

Running: /Users/gregor/Experiment/demos/PsychoPy2 Demos/mental_rotation/MentalRot_lastrun.py
2017-11-29 20:59:13.872 Python[6510:112118] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/x7/q6twv9l503q92mwzhvj_zmwh0000gn/T/org.python.python.savedState
Traceback (most recent call last):
File “/Users/gregor/Experiment/demos/PsychoPy2 Demos/mental_rotation/MentalRot_lastrun.py”, line 70, in
ISI_2 = clock.StaticPeriod(win=win, screenHz=expInfo[‘frameRate’], name=‘ISI_2’)
NameError: name ‘clock’ is not defined

Running: /Users/gregor/Experiment/demos/mental_rotation/MentalRot_lastrun.py

2017-11-29 20:59:53.520 Python[6553:112538] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/x7/q6twv9l503q92mwzhvj_zmwh0000gn/T/org.python.python.savedState
Traceback (most recent call last):
File “/Users/gregor/Experiment/demos/mental_rotation/MentalRot_lastrun.py”, line 70, in
ISI_2 = clock.StaticPeriod(win=win, screenHz=expInfo[‘frameRate’], name=‘ISI_2’)
NameError: name ‘clock’ is not defined

Running: /Users/gregor/Experiment/demos/keyNameFinder/untitled_lastrun.py

0.1771 WARNING pyo audio lib was requested but not loaded: ImportError(‘No module named pyo’,)
4.4454 WARNING unknown type:participant
4.4454 WARNING unknown type:session
2017-11-29 21:00:18.664 Python[6595:112889] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/x7/q6twv9l503q92mwzhvj_zmwh0000gn/T/org.python.python.savedState

Running: /Users/gregor/Experiment/demos/keyNameFinder/untitled_lastrun.py

0.2926 WARNING pyo audio lib was requested but not loaded: ImportError(‘No module named pyo’,)
4.8048 WARNING unknown type:participant
4.8049 WARNING unknown type:session
2017-11-29 21:05:12.722 Python[6659:117588] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/x7/q6twv9l503q92mwzhvj_zmwh0000gn/T/org.python.python.savedState

Should I expect that these demos work? This is code I got from master I think yesterday?

Anyone have any experience with this?

On the first issue at least, did you search this forum before posting?

Hi Michael

Yes I did search the forum for a solution as well as extensive google searches. Your response to the thread which you posted above is in my opinion incorrect - the demo, at least for me, is not working and I speak as a software developer who has been developing commercially since 2001.

Thanks
Gregor

I think we’re talking at cross-purposes here. I agree the demo isn’t working (in terms of the images not being visible on screen), and provided a simple fix in that other thread. Did you apply it?

The other poster had a separate issue (of images missing on disk) which I couldn’t duplicate. But that isn’t your problem here.

Hi Michael

Apologies - yes I did a git pull and the demo is working. I desperately want to be impressed with psychopy :slight_smile: Thanks for the quick response.

Gregor

1 Like

Great. At least one of your other issues is due to you not having the pyo sound library installed. This library would come with the standalone PsychoPy distribution automatically but as it sounds like you have a develop installation, you’ll be responsible for installing pyo.

If pyo still causes problems, you can also try specifying another library as the sound backend via PsychoPy’s preferences.

Thanks Michael - I don’t need sound at the moment but thanks for pointing it out. I did do the .pkg install originally but what I found was the psychopy was for some reason taking something like 90% cpu and taking a very long time to start - and then crashing after I clicked to close the “tip of the day”. After a few times of that it did start to work better - without me changing anything. Then I decided to pull from github but as part of that I had to install python from python.org as the system installed python on my Mac (Sierra) wasn’t happy with psychopy - can’t remember the details. This is a clean install of Sierra about two weeks ago. I am trying to help a psychology student with an experiment - and for that once I have the experiment in python I will try to use the automatic port into JS and then fix whatever isn’t working and deploy probably to azure - at which point I will circle back and take another look at psychopy/psychojs. Not moaning - very much can see the value of the project and to say I’m not impressed is harsh. I can see the hard work and sweat that’s gone into the project. But it’s not been a seamless experience which is very much what I think would be a better position to be in

Just to mention that before trying it on my mac I did try an ubuntu deploy in Azure - but that was a headache. I appreciate that it makes no sense to add cloud latency to experiment but in my case it would have been useful as I care only does the experiment work not about timing (i’m developing it not running it). I also considered trying to get it to run in docker but anyway I have an ETA for this work so fell back to bare mac - sorry for lengthy reply :slight_smile:

I know you are using github to track issues - not really used to doing that yet. I’ve spun up a JIRA instance to try to keep track of bugs that I find. https://gheaki.atlassian.net/projects/PSYCHPY
I can give you access if you want.