Psychopy is not syncing experiment to Pavlovia

URL of experiment: NA

Description of the problem:

Here’s the error I am getting when I try to sync my experiment to Pavlovia, this started today as a few days ago I synced a few experiments with Pavlovia

Traceback (most recent call last):
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 1240, in onPavloviaRun
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 719, 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 236, in writeScript
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/routine.py”, line 140, in writeInitCodeJS
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/components/textbox/__init__.py”, line 257, in writeInitCodeJS
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/params.py”, line 215, in __str__
TypeError: Can’t represent a Param of type color

Could you tell us what version number you’re using? It might be this is something @TParsons has already fixed

Hey, I am using the updated version, version 2021.1.1 it seems to have something to do with the code component because it works without it. I’ll write my code component:
Begin experiment:

expInfo['trial_length']=180
expInfo['trial_num'] = 0


def reverse(text):
    if len(text) <= 1:
        return text
    return reverse(text[1:]) + text[0]

eng_to_heb  = {'a' : u'ש', 'b' : u'נ', 'c' : u'ב', 'd' : u'ג',
    'e' : u'ק', 'f' : u'כ' , 'g' : u'ע' , 'h' : u'י', 'i' : u'ן', 
    'j' : u'ח', 'k' : u'ל', 'l' : u'ך', 'm' : u'צ' , 'n' : u'מ', 
    'o' : u'ם', 'p' : u'פ', 'q' : u'/', 'r' : u'ר', 's' : u'ד',
    't' : u'א', 'u' : u'ו',  'v': u'ה', 'backslash' : u"",
    'w' : u"'", 'x' : u'ס', 'y' : u'ט', 'return' :  u"",
    'lctrl' :  u"", 'rctrl' :  u"", 'lshift' :  u"", 'rshift' :  u"",
    'tab' :  u"",'capslock' :  u"",'lalt' :  u"",'ralt' :  u"",'quoteleft' :  u"",
    'z' : u'ז',  'slash' :  u".", "comma" : u"ת", u'ת':u'ת',
    'bracketright' :  u"",'bracketleft' :  u"",'equal' :  u"",'minus' :  u"",
    "semicolon" : u'ף', 'period' : u'ץ' , 'aspostrophe' : u',',
    'space' : ' ','1':'','2':'','3':'','4':'','5':'','6':'','7':'','8':'','9':'','0':'','`':''}

Eachframe:

#get eurika time
if event.getKeys(keyList = ["space"]):
    textbox_image.setAutoDraw(True)
    eurekaTimeList.append(t)
    fireButton_clicked_now = True
    event.clearEvents('keyboard')
    
if len(eurekaTimeList):
    #handle pops
    if bool(event.getKeys(keyList = ["tab"])) and ans_string != "":
        endTrialTime = t
        continueRoutine = False 
    else:
        if ans_string != "" and bool(event.getKeys(keyList = ["backspace"])):
            charsEntered.pop()
        #get new chars entered
        newChars = event.getKeys()
        if newChars:
            for each in newChars:
                charsEntered.append(eng_to_heb[each])
        #create string out of list
        ans_string = reverse("".join(charsEntered))
        
if t >= expInfo['trial_length']:
    skip_assurance = True
    endTrialTime = t
    remaining_items.append((currentWordList, currentAnsList))
    continueRoutine = False

In experiment settings, what version is your experiment set to use? If the version you have installed is 2021.1.0 but the version specified in experiment settings is 2020.2.10 or earlier, then PsychoPy will try to compile to 2020.2.10 and won’t know what to do with color-type params as these didn’t exist in 2020.2.10, so changing the version in there should fix it.

We have an alert for the other way around (running a new experiment in an old version), but I’ll add an alert for this too for future error catching!

Hi Jon, it was on the latest version, 2021.1.1 and then again when I used 2020.2.9 and had the same problem. But today it seems like it’s working…hmmm maybe I was saving the experiment in the cloud?

Vassilis

Hi, I am not sure if I am doing something wrong (I am a novice), and if this is related to the issues in this thread, but this is the error I get when I try to upload my new experiment to Pavlovia.

I have used no code elements and (as I work with the 2021.1.0 version) I have tried specifying my experiment settings to 2021.1.0 (which did not work) and 2020.2.10 (which did not work either).

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 1325, in onPavloviaSync
    retVal = pavlovia_ui.syncProject(parent=self, project=self.project)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 1416, in project
    elif self.filename and pavlovia.getProject(self.filename):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\projects\pavlovia.py", line 1068, in getProject
    gitRoot = getGitRoot(filename)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\projects\pavlovia.py", line 1049, in getGitRoot
    cwd=str(p)).decode('utf-8'):
  File "C:\Program Files\PsychoPy3\lib\subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "C:\Program Files\PsychoPy3\lib\subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'branch', '--show-current']' returned non-zero exit status 128.

@Anouk that error is a separate thing, which we released a quick fix for yesterday (2021.1.1)

2 Likes