Unable to sync with Pavlovia, local version works

URL of experiment:

Description of the problem: Created an experiment in PsychoPy3, which works fine locally. Attempted to push to Pavlovia for online remote testing. Clicking Pavlovia.org → New elicits this error:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui\project.py”, line 166, in submitChanges
self.parent.project = self.project
AttributeError: ‘NoneType’ object has no attribute ‘project’

After that, there is an Experiment at Pavlovia that has nothing in it. Trying to sync with web project to update kicks up this:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1344, in onPavloviaSync
self.fileExport(htmlPath=htmlPath)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 793, in fileExport
target=“PsychoJS”)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 74, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 247, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 219, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 254, in writeScript
self_copy.flow.writeFlowSchedulerJS(script)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\flow.py”, line 309, in writeFlowSchedulerJS
resourceFiles = set([resource[‘rel’].replace("\", “/”) for resource in self.exp.getResourceFiles()])
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 877, in getResourceFiles
condsPaths = findPathsInFile(params[‘conditionsFile’].val)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 865, in findPathsInFile
for thisFile in findPathsInFile(val):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 848, in findPathsInFile
thisFile = getPaths(filePath) # get the abs/rel paths
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 810, in getPaths
thisFile[‘rel’] = os.path.relpath(filePath, srcRoot)
File “C:\Program Files\PsychoPy\lib\ntpath.py”, line 586, in relpath
path_drive, start_drive))
ValueError: path is on mount ‘F:’, start on mount ‘C:’

Any suggestions gratefully received.

Is your experiment on your F: drive? If so, can you try in on your C: drive?

Are you logged into Pavlovia in Builder?

It was initially on F: but spotting that that might have been an issue I created a clean copy on C: and made sure there were no references to F:

Yes, I’m logged in in builder

How clean a copy? If you are getting a reference to F: in the error message then there it must still be there. Did you delete the .git folder and files?

Found an errant reference to F: in one of the spreadsheets. Now getting this error in Pavlovia

  • TypeError: core.CountdownTimer is not a constructor

For context, I have a countdown visible on screen during one loop in the experiment, counting backwards from 10 minutes as an indication of how long the participant has left to complete that set of trials. I’ve set that up using the following code - I’m assuming that this is linked to the issue?

Begin experiment
countdownStarted = False

Begin Routine
if not countdownStarted:
countdownClock = core.CountdownTimer(600)
countdownStarted = True

Each Frame
timeRemaining = countdownClock.getTime()
if timeRemaining <= 0.0:
continueRoutine = False
timedtrials.finished = True

else:
minutes = int(timeRemaining/60.0)
seconds = int(timeRemaining - (minutes * 60.0))
timeText = str(minutes) + ‘:’ + str(seconds)

Then timeText is called by a text presentation

Any help gratefully received…again :slight_smile:

This means that the object doesn’t work online. You will need to use a normal clock.

Begin experiment

countdownStarted = False
countdownClock = core.Clock()
# JS code is countdownClock = new util.Clock()

Begin Routine

if not countdownStarted:
countdownClock.reset()
countdownStarted = True

Each Frame

timeRemaining = 600 - countdownClock.getTime()
if timeRemaining <= 0.0:
     continueRoutine = False
     timedtrials.finished = True
else:
     minutes = int(timeRemaining/60.0)
     seconds = int(timeRemaining - (minutes * 60.0))
     timeText = str(minutes) + ‘:’ + str(seconds)

Thanks - still works with the new code offline, but getting the message that core.Clock isn’t a constructor either.

In other news, another version of the experiment without the timer component isn’t able to find the images as follows:

  • when setting the image of ImageStim: Sequence2
  • when getting the value of resource: C:\Users\User\Documents\Time pressure group\Images\Q1.png
  • unknown resource

I’ve had a little look at other threads that have similar “unknown resource” errors and I am not following them - there seem to have been multiple different solutions suggested that sometimes work and sometimes don’t. Not sure where to start with it.

You need to use a Both code component and use the code I gave for JS on the JS side instead of core.Clock.

Have you attached resources via Experiment Settings / Online / Additional Resources ?

I have - is it because the reference in the spreadsheet is incorrect in some way?

Sorry, I should have looked closer. You are referencing a location on your C: drive. Is this in your spreadsheet or in the image component?

It’s in the spreadsheet

Your spreadsheet needs to point to a relative path, such as images/filename.png

If you have lots of spreadsheets then an alternative would be to use code to correct the path (copying to a new variable name so you don’t try to edit the spreadsheet variable

Ah! That has fixed that part of the problem - I’m still having issues with the timer though.

  • ReferenceError: minutes is not defined

You’re being so helpful and supportive, I can’t thank you enough!

Put minutes = 0 in Begin Experiment