Retrieve psychopy version from psydat file

Dear all,

I collected data a while ago, and I would need to retrieve the exact psychopy and python version that was used. The computer that was used has likely been updated in the meantime, so I cannot rely on the current versions installed there.

Is there a way to retrieve such info from the psydat file? If so, how can this be done?

Thanks!
Silvia

Hi @Silvia, if the PsychoPy version was saved in the datafile, then you should be able to get this from the psydat file. Try the following from the Coder window (see online docs):

from psychopy.misc import fromFile

datFile = fromFile('data/_colPal.psydat')
# get info (added when the handler was created)
print(datFile.extraInfo)

for entry in datFile.getAllEntries():
    for key,value in entry.items():
        print(key,value)

Dear David,
thanks for your input!

I tried your suggestion. In PsychoPy3, I fail to read the psydat file and I get the following error:

UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xfa in position 6: ordinal not in range(128)

In PsychoPy2, I can import the file and print the extraInfo, but I get the following AttributeError after the loop:

Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘ExperimentHandler’ object has no attribute ‘getAllEntries’

It also fails to retrieve:

print(datFile.data)
AttributeError: ‘ExperimentHandler’ object has no attribute ‘data’

print(datFile.trialList)
AttributeError: ‘ExperimentHandler’ object has no attribute ‘trialList’

Thanks again

Thanks, which version of PsychoPy are you using?

In PsychoPy2 I have a very old version: v1.85.4

In PsychoPy3: v3.2.4