Psychopy v2023.2.1 error on running previous protocols

OS (e.g. Win10): Win11 22H2
PsychoPy version (e.g. 1.84.x): 2023.2.1
Standard Standalone? (y/n) yes
What are you trying to achieve?: Run experiments made in previous versions of Psychopy

What specifically went wrong when you tried that?:
I updated to the last Psychopy version and had the error down bellow while trying to run some experiments made on previous versions, which is all my current experiments and some of the new ones under development. No previous version was older than 2022.1.4 (I was building the experiments at home and at work. Different computers with different psychopy versions. Newer at work). I have already tried to run using the ā€œUse Psychopy versionā€ resource and it works fine. I am posting this just in case it is some sort of bug worth checking.

Thanks.

  File "D:\Google Drive\Meu Drive\Pesquisa\Medicina\23.1 Trabalhadores em turnos e as funƧƵes executivas (Thaƭs e Stella)\Experimento\ShiftWorkers.py", line 9437, in <module>
    logFile = setupLogging(filename=thisExp.dataFileName)
  File "D:\Google Drive\Meu Drive\Pesquisa\Medicina\23.1 Trabalhadores em turnos e as funƧƵes executivas (Thaƭs e Stella)\Experimento\ShiftWorkers.py", line 153, in setupLogging
    return logFile
NameError: name 'logFile' is not defined
################ Experiment ended with exit code 1 [pid:26968] #################

I am having the same issue. We bought a few more laptops for testing and programs made in an older version of psychopy now give ā€œnameError: name ā€˜logFileā€™ is not definedā€. I have gone into settings and set the version to the one that the program was made in (2022.2.5), but then the program runs incredibly slowly. Hopefully someone will have an answer!

This is a bug, itā€™s essentially that the variable logFile is only created if ā€œSave log fileā€ is checked in Experiment Settings, but as of 2023.2.0 itā€™s referred to regardless, hence the error.

Weā€™ve got a fix for this which will be in 2023.2.2, in the meantime ticking ā€œSave log fileā€ in Experiment Settings should avoid this error.

2 Likes

Perfect! Thank you very much!

Hello Todd and everyone else.

I donā€™t want to open yet another thread, but found another issue on updating PsychoPy.

I have created an Ishihara task for color blind screening. I present the plate, add five dynamic text components for options and a slider for responses (radio style). All plates and answering options are in an excel file. This worked great to collect responses and I had even added probable responses for normal vision, Protanopia/Protanomaly and Deuteranopia/Deuteranomaly, meaning I can provide imediate feedback to participants. Of course this is not 100% acurate, but it attends my exclusion criteria necessity. But I digressā€¦

As it is, and independent of code components, the slider doesnā€™t work anymore. The first trial appears, plate and text components, but as soon as I choose one of the responses the loop crashes with the following error:

  File "D:\Google Drive\Meu Drive\Pesquisa\Medicina\23.1 Trabalhadores em turnos e as funƧƵes executivas (Thaƭs e Stella)\Experimento\ShiftWorkers_lastrun.py", line 9346, in <module>
    run(
  File "D:\Google Drive\Meu Drive\Pesquisa\Medicina\23.1 Trabalhadores em turnos e as funƧƵes executivas (Thaƭs e Stella)\Experimento\ShiftWorkers_lastrun.py", line 3569, in run
    win.flip()
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\window.py", line 1159, in flip
    thisStim.draw()
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\slider.py", line 804, in draw
    self.getMouseResponses()
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\slider.py", line 895, in getMouseResponses
    self.recordRating(self.markerPos)
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\slider.py", line 765, in recordRating
    setAttribute(self, attrib='rating', value=rating, operation='', log=log)
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\tools\attributetools.py", line 134, in setAttribute
    setattr(self, attrib, value)
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\slider.py", line 738, in rating
    rating = self.labels[int(round(rating))]
TypeError: 'NoneType' object is not subscriptable

My question is: is there significant changes to the behavior of the slider component in the current PsychoPy version?! As tested before, if I force the use of previous versions (e.g. 2022.1.4), the loop works just fine.

Iā€™ll be glad to provide further information if needed.
Thanks a lot.