2021.1.4 Error when setting conditions

OS (e.g. Win10): MacOS Catalina 10.15.7
PsychoPy version (e.g. 1.84.x): 2021.1.4
Standard Standalone? (y/n) y

I was attempting to select between multiple conditions files using a variable but PsychoPy was not reading any of the files.

Received this error when I attempted to select a specific conditions file through the file selector to debug:

  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/dialogs/__init__.py”, line 1535, in onBrowseTrialsFile
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/data/utils.py”, line 417, in importConditions
IndexError: list index out of range

Is there a previous version of PsychoPy that does not have this error? I only just updated from 2020.2 because I encountered the following type of error and saw that the advice was to update.

ImportError: sys.meta_path is None, Python is likely shutting down

That doesn’t sound like a version error. How are you selecting rows? I find that the x:y format works best with 0:1 etc to select a single row.

I’m using a variable that contains a list of rows formatted like “1,2,3,4,5” etc. (The selection is not sequential so I cannot use the x:y format). Looking back at my code it looks like I used the .join() method to create these selections, which I believe is not yet supported in the conversion so I think I may have found the issue.

1 Like

Further update: I realized the actual issue was with the conditions file itself. I had done some processing using pandas before writing the conditions to an excel file, but writing a pandas dataframe directly will include an index column with an empty header. The latest Psychopy version (2021.1.4) has the above unhandled error if you attempt to import a conditions file with an empty header. It seems to be working fine as long as I enter some placeholder text into that empty cell (or the column could be removed entirely).

1 Like