psychopy.org | Reference | Downloads | Github

Missing Routine when Uploading to JavaScript

Currently, I am trying to add more routine into my experiment. I have successfully uploaded my local Python code to online JavaScript many times before but this time, after many tries, the online version stayed the same as my last upload last week.

OS : MacOS 10.13.6
PsychoPy version : v2021.1.2
Standard Standalone? (y/n) y
What are you trying to achieve?:
I have my main experiment completed (and uploaded to online as well) and I am now adding some routines for a brief Line Bisection Task using sliders in between the two blocks. Each routine includes some text, a slider, and a code component that defines the start of the marker position and allows the participant to move the marker from right to left using keys.

What did you try to make it work?:
It works locally and it showed up on my Python code when I inspect the coding view; however, when it is synced the routine doesn’t show up on Pavlovia and to look more into it I specifically convert it to the JS view, none of the newly added routines are in there. I also tried to convert it to JS and upload it to Pavlovia but the line bisection component didn’t show up. I also made sure that I clear any keyboard events at the end of a routine preceding these newly added ones but it didn’t make much of a change.

I have searched through the forums and double-checked that I am using the latest version of PsychoPy (and also set it in the experiment setting as well). I checked the PsychoPy Crib Sheet for anything specific to sliders and read through the links referenced on there too. There are some discussion on that forms works locally but disappears on Pavlovia. I wasn’t sure if that is the case happening with the slider?

What specifically went wrong when you tried that?:
The newly added routine still didn’t show up after multiple tries of just uploading single trials to troubleshoot. The experiment just continues to run without showing the added routine and it just seems similar to the code from several commits ago.

Any help would be appreciated,
and thank you very much!

Are you clearing your cache (Ctrl-Shift-R)?

Hello, thank you for your reply! Yes, I am clearing the cache and checking to make sure that I am running on the latest code. But when I go into View Code and see the files uploaded, sometimes the JS script is not updated to my latest commit. And even when I convert the JS script separately offline to search for the new routine in the code, I can’t seem to find it? This is the first time I’ve encountered this problem trying to upload a new part of the experiment online.

I was wondering if it had anything to do with my file path? When I am uploading it gives me these INFO lines. The experiment being updated is called MA_Pilot.psyexp. which is located inside a folder called First_Pilot
3925.2690 INFO /Applications/PsychoPy.app/Contents/MacOS/python -m psychopy.scripts.psyexpCompile /Users/GraceW./First_Pilot/MA_Pilot.psyexp -o /Users/GraceW./First_Pilot/MA_Pilot.py -v 2021.1
4087.4218 INFO Investigating repo at /Users/GraceW./First_Pilot

Any pointers would be greatly appreciated. Thank you.

Are you getting any errors when you sync? If the JS file on Gitlab isn’t updating then that probably means there was an error when PsychoPy tried to create the new file.

Thank you again for the prompt response. I had encountered an error when I am syncing with my old PsychoPy version (which was just left blank in the experiment setting). The error details were:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 822, in findPathsInFile
File “”, line 1, in
NameError: name ‘group’ is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/openpyxl/reader/excel.py”, line 121, in _validate_archive
File “zipfile.pyc”, line 1131, in init
File “zipfile.pyc”, line 1198, in _RealGetContents
zipfile.BadZipFile: File is not a zip file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 1320, in onPavloviaSync
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 759, in fileExport
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 73, in generateScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 242, in compileScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 214, in _makeTarget
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 229, in writeScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/flow.py”, line 289, in writeFlowSchedulerJS
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 870, in getResourceFiles
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 836, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 853, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/data/utils.py”, line 365, in importConditions
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/openpyxl/reader/excel.py”, line 174, in load_workbook
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/openpyxl/reader/excel.py”, line 124, in _validate_archive
File “zipfile.pyc”, line 1131, in init
File “zipfile.pyc”, line 1198, in _RealGetContents
zipfile.BadZipFile: File is not a zip file

The ‘group’ referred to is a string variable in the code component at the beginning of the experiment to counterbalance participants. I went on the forum discussion and found a solution where I was able to upload without error by changing the PsychoPy version to specify the 2021.1. But perhaps simply changing the version didn’t completely solve the problem? Maybe changing the version to be different from what I used before interrupted how JS file is generated on Gitlab?

Thank you for your time!

You are using one of my versions to avoid so it might be worth upgrading.

Thank you for this!

I have upgraded my PsychoPy to 2021.1.4 and restarted my experiment on it. In the experiment setting, I also set the use PsychoPy version to 2021.1.4 as well. However, when I tried to sync it gave me a similar internal error:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 829, in findPathsInFile
File “”, line 1, in
NameError: name ‘group’ is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/openpyxl/reader/excel.py”, line 121, in _validate_archive
File “zipfile.pyc”, line 1131, in init
File “zipfile.pyc”, line 1198, in _RealGetContents
zipfile.BadZipFile: File is not a zip file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 1320, in onPavloviaSync
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 759, in fileExport
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 73, in generateScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 242, in compileScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 214, in _makeTarget
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 229, in writeScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/flow.py”, line 289, in writeFlowSchedulerJS
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 877, in getResourceFiles
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 843, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 860, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/data/utils.py”, line 365, in importConditions
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/openpyxl/reader/excel.py”, line 174, in load_workbook
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/openpyxl/reader/excel.py”, line 124, in _validate_archive
File “zipfile.pyc”, line 1131, in init
File “zipfile.pyc”, line 1198, in _RealGetContents
zipfile.BadZipFile: File is not a zip file

So, just seeing what works and what doesn’t, when I changed the PsychoPy version to 2020.2.10 in the experiment setting, it will upload without error but the JS remains the same.

Thank you for all your help!

Just a brief happy update :smile: I found a solution from looking at the other two similar discussions:

What I ended up doing was to try and upload a simple test sequence onto Pavlovia and realize my path is not set correctly. So I went back to my folder to look for the hidden .git folders to delete them (on MacOS, I went to the folder and held down the Command, Shift and Period keys: cmd + shift + [.] the hidden folder will appear transparent until you held down the same keys again).

And I just make sure I am using and set to the latest PsychoPy version (not on the avoid list) and re-uploaded my local experiment as a new project on Pavlovia and now it works!
Thank you again for your response and time.

1 Like