Python variable undefined in pavlovia

URL of experiment:

Description of the problem:
I’m running a super simple two-routine experiment just to experiment with Pavlovia. The 1st routine displays ‘Hello’ for 2 seconds and the 2nd one displays a text variable that is defined in a Python code component in the Before experiment tag:

import pandas as pd
import numpy as np
import yaml

textText = 'Bla Bla Blaaa'

(Yes, I promised stupid…)

However, I’m getting the following error message:
** Unfortunately we encountered the following error:

  • ReferenceError: textText is not defined**

Of course everything runs well locally .

Looking at my Dummy1_lastrun.py in the repository I get:

...
import pandas as pd
import numpy as np
import yaml

textText = 'Bla Bla Blaaa'
...

Ideas?
Thanks!

Hello Uri,

you can’t use python libraries in PsychoJS via a code-element. See Wake Carter’s crib sheet. PsychoPy automatically loads all PsychoJS-libraries it needs.

Best wishes Jens