psychopy.org | Reference | Downloads | Github

Problem import xlsx conditions file


#1

Hi,

I had an experiment with eye tracker (EyeLink, using PyGaze) which was run OK in PsychoPy 1.82.01.

I now migrated to version 1.84.2 and I encounter the following problems:

  • In the experiment, a movie is shown. I can hear the movie but I get a black screen.
  • I use a conditions xlsx file in a loop. I did not change anything in the file but at the end of the first iteration I get an error:
  File "D:\Rotem\pygaze-cocktail-pilot\CocktailPartyWithQuestionsWorkingAndBreakAddRandom.py", line 400, in <module>
    trialList=data.importConditions(questions_file),
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\data.py", line 2689, in importConditions
    _assertValidVarNames(fieldNames, fileName)
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\data.py", line 2601, in _assertValidVarNames
    raise ImportError(msg % fileName)
ImportError: Conditions file questions/04.xlsx: Missing parameter name(s); empty cell(s) in the first row?

Of course the first line is not empty.

What could cause this and how do I fix it ?

Thanks in advance!
Noa


#2

I don’t think it’s suggesting that the entire header row is empty but there is an empty cell in it. COuld you upload the xlsx file here for us to test?


#3

02.xlsx (8.8 KB)

This is the file.

Again, in PsychoPy 1.82.01 it is working well (I have each version installed on a different computer)

Also, do you have any suggestion what could be the problem with the movie display?

Thanks !!
Noa


#4

The file is saved in a right-to-left manner (Hebrew or such??), which the simple importConditions function cannot handle. pandas however is able to load the file just fine.

We should definitely switch importConditions to use pandas.

Do you use the Coder or the Builder?


#5

That might help, but the other problem (which may be caused by the right-to-left aspect), is that the xlsx file does seem to be encoded with some extra columns of nothing. To me it looks like some application has added some empty columns to you file for no good reason. If I save the file as a csv file instead and then open it in a text editor it looks like this:

question,correct_response,,,,,,,,,,,
questions\02\Slide4.JPG,3,,,,,,,,,,,
questions\02\Slide5.JPG,1,,,,,,,,,,,
questions\02\Slide6.JPG,2,,,,,,,,,,,
questions\02\Slide7.JPG,3,,,,,,,,,,,

I was able to fix the import by copying the genuine data to a new file and saving it again. 02b.xlsx (25.5 KB)

I’m afraid that PsychoPy isn’t smart yet about working out whether blanks in a file could be safely ignored (as in this case) or whether they are a problem.

Out of interest, what was the file created in Noa?


#6

The file was generated in Excel and PsychoPy 1.82.01 was OK with the exact same file.
However, I did try a small testcase to test the xlsfile on a new simple “experiment” and found that if I just copy the relevant cells to a new excel file it worked. I will proceed to check that on my original experiment.

If this is fixed then I just have the problem with the movie, why it is not displayed although it is heard, while a simple picture is shown before. Again, in 1.82.01 it did work fine.
What are the major changes regarding display sine 1.82.01 version?


#7

I don’t know why the movie isn’t working - I’m not aware of anything changing or any bugs around this that cropped up recently. Very hard to know what might have caused it from the little info here. Is this an issue with all movies? Which backend are you using (MovieStim, MovieStim2/opencv or Moviestim3/pymovie)? Could you show us the params of your stimulus?


#8

Thanks Jon, this answer was helpful for me too! I was having a similar problem. It turned out, I had a default header, “Table 1” in my excel that I guess psychopy didn’t understand.


#9

Hi everyone,

I am dealing with even a simpler problem. I wanted to create a strooper test, and I cannot import a simple xlsx file. Psychopy either doesn’t recognise it.

Thank you for your help in advance.


#10

There is not sufficient information here to give an answer. As suggested elsewhere to you by @Jin_Jeon:

  • please make your own topic rather than add to an existing one, and
  • actually provide the level of detail needed. e.g. Paste in the text of any error messages. “Psychopy either doesn’t recognise it.” doesn’t mean anything useful to us.