How to solve the problem : "ValueError: listFromString requires a string as its input not 0.1"

I’m sorry if it is a silly question.
ValueError: listFromString requires a string as its input not 1.2
please help me ,thanks

OS :Win10
PsychoPy version (e.g. 1.84.x): v2022.2.24
Standard Standalone? (y/n) :y
What are you trying to achieve?:
I want to use the form component to create a scale.
What did you try to make it work?:
I used the excel template in the forms component, as follows:

What specifically went wrong when you tried that?:

this is the output of PsychoPy Runner

Running: C:\Users\lsh\Desktop\work of psychopy\work2\

62.2026 INFO Loaded monitor calibration from [‘2022_10_28 10:16’]
pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
E:\psychopy\lib\site-packages\psychopy\data\ SettingWithCopyWarning:
Hello from the pygame community. Contribute - pygame wiki
1.6120 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use [‘sounddevice’, ‘PTB’, ‘pyo’, ‘pygame’] (in that order).
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: Indexing and selecting data — pandas 2.1.1 documentation
trialsArr[col][row] = float(tryVal)
Traceback (most recent call last):
File “C:\Users\lsh\Desktop\work of psychopy\work2\”, line 100, in
form1 = visual.Form(win=win, name=‘form1’,
File “E:\psychopy\lib\site-packages\psychopy\visual\”, line 151, in init
self.items = self.importItems(items)
File “E:\psychopy\lib\site-packages\psychopy\visual\”, line 332, in importItems
item[‘ticks’] = listFromString(item[‘ticks’])
File “E:\psychopy\lib\site-packages\psychopy\data\”, line 173, in listFromString
raise ValueError(“listFromString requires a string as its input not {}”

ValueError: listFromString requires a string as its input not 0.1

################ Experiment ended with exit code 1 [pid:11764] #################
70.6286 INFO Loaded monitor calibration from [‘2022_10_28 10:16’]

Thank you

The issue lies in the ‘a,b’ within the options. You need to add a space after the comma, making it ‘a, b’. If the format is not like this, it will result in an error.

1 Like

Since some components of psychopy are still in beta testing, the form component comes with a scale template that has formatting issues, so you can either save the format as a .csv or look for a template file that doesn’t have formatting issues.

What input have you given it? "1,2" might be a suitable string. 1.2 is a decimal

What does your form item file look like?

I created the form file in this way

Remove the tick from after the final tickLabel

I tried to remove it from ticklabels, but it was still wrong.But when I used the form that someone else had sent me, the problem was solved.Maybe there’s something wrong with the form I downloaded.
Thank you for taking the time to help me.