Problems for participants running code on other computers

I’ve written a PsychoPy experiment that I want lots of people to be able to download and run, preferably on both Mac and PC (I’ve written it on Mac OS). I’ve written it in v1.90.2 and so am instructing participants to download that, and Python 2.7.13, to run it (from https://github.com/psychopy/psychopy/releases/tag/1.90.2 and https://www.python.org/downloads/release/python-2713/ respectively)

What are the standard issues that seem to come up when participants load up PsychoPy experiments for the first time on other computers? I’m trying to make a set of instructions that are as clear as is possible for people…

I gave it to somebody to test yesterday, and when they tried to run it they received the following:

Traceback (most recent call last):
File "/Users/username/Downloads/AP_experiment_02.19/AP_pretest.py", line 3, in <module>
from psychopy import locale_setup, sound, gui, visual, core, data, event, logging
File "/Applications/[PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/sound/__init__.py](http://psychopy2.app/Contents/Resources/lib/python2.7/psychopy/sound/__init__.py?fbclid=IwAR2vZnZscgakzoZtGfxTXGhCGN3-g3sov_ZVq0bPbRnvwfOY7hT3RS9FYHs)", line 79, in <module>
from . import backend_sounddevice as backend
File "/Applications/[PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/sound/backend_sounddevice.py](https://l.facebook.com/l.php?u=http%3A%2F%2FPsychoPy2.app%2FContents%2FResources%2Flib%2Fpython2.7%2Fpsychopy%2Fsound%2Fbackend_sounddevice.py%3Ffbclid%3DIwAR2gBsYW81h5TUDrzelVjTXAnkLpa_O-NhQ28okmmsZPbpzRP-29VOC3tAo&h=AT0D63jcvQVlqSCWXKm4N_goqyForNbwdRcNwrKjaTu0LbnfaQ_moWL_bXXO2cVAnkXhqk9VbgKhzTaipXjSop7lHK6pcw4n9WFsy5NzxY9BWqbH9LGtLNrOlmdpY3Z2FZiJLx15XdPagyH9OUsKEjWB)", line 20, in <module>
import soundfile as sf
File "soundfile/__init__.pyc", line 1, in <module>
File "soundfile/soundfile.pyc", line 270, in <module>
File "/Applications/[PsychoPy2.app/Contents/Resources/lib/python2.7/cffi/api.py](https://l.facebook.com/l.php?u=http%3A%2F%2FPsychoPy2.app%2FContents%2FResources%2Flib%2Fpython2.7%2Fcffi%2Fapi.py%3Ffbclid%3DIwAR0Ydl8sQxpoFmW31G66GNIkrV68aQ1C0sfLYaZgcnSAJwej_xcpb7Z4t3Q&h=AT0D63jcvQVlqSCWXKm4N_goqyForNbwdRcNwrKjaTu0LbnfaQ_moWL_bXXO2cVAnkXhqk9VbgKhzTaipXjSop7lHK6pcw4n9WFsy5NzxY9BWqbH9LGtLNrOlmdpY3Z2FZiJLx15XdPagyH9OUsKEjWB)", line 141, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "/Applications/[PsychoPy2.app/Contents/Resources/lib/python2.7/cffi/api.py](https://l.facebook.com/l.php?u=http%3A%2F%2FPsychoPy2.app%2FContents%2FResources%2Flib%2Fpython2.7%2Fcffi%2Fapi.py%3Ffbclid%3DIwAR3xGeTKflbYPg4cJpevtPFiob_dcY1UpVOiSHBEGrJDngwY9AHog_kG3EQ&h=AT0D63jcvQVlqSCWXKm4N_goqyForNbwdRcNwrKjaTu0LbnfaQ_moWL_bXXO2cVAnkXhqk9VbgKhzTaipXjSop7lHK6pcw4n9WFsy5NzxY9BWqbH9LGtLNrOlmdpY3Z2FZiJLx15XdPagyH9OUsKEjWB)", line 802, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "/Applications/[PsychoPy2.app/Contents/Resources/lib/python2.7/cffi/api.py](https://l.facebook.com/l.php?u=http%3A%2F%2FPsychoPy2.app%2FContents%2FResources%2Flib%2Fpython2.7%2Fcffi%2Fapi.py%3Ffbclid%3DIwAR1-I9TfpOBqu6BGIrUBlpb193E6PFBvyNXcCMN_4evGlxgGZQke38zl0XA&h=AT0D63jcvQVlqSCWXKm4N_goqyForNbwdRcNwrKjaTu0LbnfaQ_moWL_bXXO2cVAnkXhqk9VbgKhzTaipXjSop7lHK6pcw4n9WFsy5NzxY9BWqbH9LGtLNrOlmdpY3Z2FZiJLx15XdPagyH9OUsKEjWB)", line 797, in _load_backend_lib
raise OSError(msg)
OSError: cannot load library '/Applications/[PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib](https://l.facebook.com/l.php?u=http%3A%2F%2FPsychoPy2.app%2FContents%2FResources%2Flib%2Fpython2.7%2Fsite-packages.zip%2Fsoundfile%2F_soundfile_data%2Flibsndfile.dylib%3Ffbclid%3DIwAR2vZnZscgakzoZtGfxTXGhCGN3-g3sov_ZVq0bPbRnvwfOY7hT3RS9FYHs&h=AT0D63jcvQVlqSCWXKm4N_goqyForNbwdRcNwrKjaTu0LbnfaQ_moWL_bXXO2cVAnkXhqk9VbgKhzTaipXjSop7lHK6pcw4n9WFsy5NzxY9BWqbH9LGtLNrOlmdpY3Z2FZiJLx15XdPagyH9OUsKEjWB)': dlopen(/Applications/[PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib](https://l.facebook.com/l.php?u=http%3A%2F%2FPsychoPy2.app%2FContents%2FResources%2Flib%2Fpython2.7%2Fsite-packages.zip%2Fsoundfile%2F_soundfile_data%2Flibsndfile.dylib%3Ffbclid%3DIwAR2BWdJZxiSAlJWPZfOnA1lfanxuc6Wz87Hqe3yKyy8-_TtijmzdbbPnZCs&h=AT0D63jcvQVlqSCWXKm4N_goqyForNbwdRcNwrKjaTu0LbnfaQ_moWL_bXXO2cVAnkXhqk9VbgKhzTaipXjSop7lHK6pcw4n9WFsy5NzxY9BWqbH9LGtLNrOlmdpY3Z2FZiJLx15XdPagyH9OUsKEjWB), 2): no suitable image found. Did find:
/Applications/[PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib](https://l.facebook.com/l.php?u=http%3A%2F%2FPsychoPy2.app%2FContents%2FResources%2Flib%2Fpython2.7%2Fsite-packages.zip%2Fsoundfile%2F_soundfile_data%2Flibsndfile.dylib%3Ffbclid%3DIwAR1SlXjE8MAloaGiVwjijnDPMiotWZmkoi0n1zrR9WtweVNu8gw5EA2gWCY&h=AT0D63jcvQVlqSCWXKm4N_goqyForNbwdRcNwrKjaTu0LbnfaQ_moWL_bXXO2cVAnkXhqk9VbgKhzTaipXjSop7lHK6pcw4n9WFsy5NzxY9BWqbH9LGtLNrOlmdpY3Z2FZiJLx15XdPagyH9OUsKEjWB): stat() failed with errno=20. Additionally, ctypes.util.find_library() did not manage to locate a library called '/Applications/[PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib](http://psychopy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib?fbclid=IwAR0Ce80QKc4jmS-2Aj6kY-324vGnaUKmEh7BaAVEjfPeRvil6SnCei36gfY)'

What’s going on there?

Also, when he loaded up PsychoPy he received the message “There were many changes in version 1.74.00 that will break compatibility with older versions. Make sure you read the changelog carefully before using this version. Do not upgrade to this version halfway through an experiment”

Given he downloaded PsychoPy v1.90.2 I’m surprised he received this message?

N.B., it’s too late in the day now to update this experiment to PsychoPy 3 (the code is quite intricate by this stage, and given that it now works as I want it to, I’m keen to leave it as it is)

Is there any reason why you’re using 1.90.2 and not 1.90.3 ?

I ignored PsychoPy 3 for a long time, only upgrading last September and moving to Pavlovia post lockdown.

1 Like

It was a while ago but I remember updating to v1.90.3 and some stuff stopped working…

As you can tell, I’ve been working on this code for quite a long time :flushed::man_facepalming:

Finally finished though fortunately! Just gotta make sure it can run on other peoples’ computers…

Fair enough.

Well that error message is actually just a warning which suggests that the experiment being opened appears to be old, rather than the version downloaded being old (or perhaps PsychoPy is just playing safe with an experiment it hasn’t seen before). It should be fine to ignore it.

I noticed a reference to facebook in the error messages you sent, which seems odd.

Did the participant actually have any problems running the experiment or did they get scared off by the warning?

1 Like

He says the experiment wouldn’t run - it just came up with those messages. Weird about the Facebook links isn’t it! Any idea what the error messages mean, or how I might go around approaching fixing them?

So another friend tried and got this:

File "/Users/ftj/Downloads/AP_experiment_02.19/AP_pretest.py", line 3, in <module>
    from psychopy import locale_setup, sound, gui, visual, core, data, event, logging
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/sound/__init__.py", line 79, in <module>
    from . import backend_sounddevice as backend
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/sound/backend_sounddevice.py", line 20, in <module>
    import soundfile as sf
  File "soundfile/__init__.pyc", line 1, in <module>
  File "soundfile/soundfile.pyc", line 270, in <module>
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/cffi/api.py", line 141, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/cffi/api.py", line 802, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/cffi/api.py", line 797, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library '/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib': dlopen(/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib, 2): no suitable image found.  Did find:
    /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib: stat() failed with errno=20.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib'

So it looks like perhaps a lot of files aren’t included in the 1.90.2 download anymore?!

Are they possibly downloading the top zip file instead of the Standalone version?

1 Like

If @wakecarter is correct and the problem is with the installation, you might make it easier for your participants if you use the useVersion feature: https://www.psychopy.org/faqs/versionControl.html
Then, your participants could just download the newest Psychopy release. You could send them your compiled script with the useVersion code integrated, which downloads the correct psychopy version before they start the experiment.
I haven’t tried this out. I just wanted to point out the feature in case you weren’t aware of it.

To use this feature, you would probably have to switch to python3 but you could still use Psychopy v1.90.3, so that might be manageable for you.

1 Like

Thanks all! Apparently he downloaded the standalone version? :thinking:
Bugger…

I had him search do a basic search on his computer for the world psychopy, and very little showed up (I was expecting to see: psychopy_post_inst.py, PsychoPy.egg-info, and a million other files containing the word psychopy…)

When I’ve downloaded PsychoPy in the past I’ve ended up with a folder in my downloads called e.g., “PsychoPy-1.90.2”

The first bunch of files and folders that come up are:

docs [folder]
LICENSE
MANIFEST.in
PKG-INFO
psychopy [folder[
psychopy_post_inst.py
PsychoPy.egg-info [folder]
README.md
setup.cfg
setup.py

Does PsychoPy read from this folder somehow, or will I have copied these files somewhere else at some point on download (it was so long ago!)

Is there anyway that the standalone download might not actually contain all of the necessary files any more?

This seems unlikely. Does PsychoPy actually start when they open it? Can they send you a screenshot of the Builder view (preferably with your experiment loaded)?

Yes they got it running, so there were definitely psychopy files on their computer otherwise it wouldn’t have opened… weird they didn’t show up on a search though?! That’s almost certainly a red herring, given psychopy runs…

They genuinely don’t seem to generate a folder called 1.90.2 on their computer though, which I have definitely got on mine. Doesn’t help I’ve completely forgotten what happens when you download it… am I correct in thinking that the folder in my downloads containing the various files is where the app reads from?

As in they got psychopy running, not my experiment. When they clicked run it sent the error messages above

Ok, so to update. I had another friend (this time someone more computer-savvy) try to get the experiment up and running on their computer and it worked fine. Two key differences are that they
a) added PsychoPy using a copy of ‘StandalonePsychoPy2-1.90.2-MacOS.dmg’ from the experiment folder, rather than from the PsychoPy website; and
b) they had Python 2.7 on their computer already

I’ve asked the original friend to check the PsychoPy application package contents for Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib

I’ve also asked them to try deleting PsychoPy and Python and reinstalling them using the files I provided for this in the experiment folder…

Fingers crossed… let me know if this generates any further thoughts?

Ok… so getting somewhere with this:

Changing a few preferences fixed it for one person:

audio library: [u’pygame’, u’pyo’, ]
audio driver: [u’portaudio’, ]

(They also changed audioDevice from auto to Built-in Output, but I presume that doesn’t make a difference?)

They did this, and have now been able to run the experiment fine.

HOWEVER, the other person tried to do exactly the same thing and psychopy wouldn’t let him make the changes. He get’s a message back saying:

Invalid value in “audio library” (“General”

Then when he goes back to the screen everything has changed to:

Audio library: [u’[’, u’u’, u"’", u’p’, u’y’, u’g’, u’a’, u’m’, u’e’, u’,’, u’u’, u"’", u’p’, u’y’, u’o’, u"’", u’,’, u’ ‘, u’]’, ]

Audio driver: [u’ coreaudio’, u’portaudio’,]

(N.B., if you look at this Audio library entry carefully, it says “u’pygame’, u’pyo’,” but with loads of 'u’s etc in it…)

Any thoughts on what could be happening, and why it’s happening to him rather than my other friend? He has a much more recent OS than my other friend - could that affect anything?