Yes, my friend! I’m using the recent version.
When I use the dollar sign in any text area, as in random variables in sense to create aleatory reading, the builder closes Psychopy.
I have no idea what happens.
Dear all,
I noticed the dollar sign is used as a delimiter to code in text fields, inside Psychopy.
However, the same sign maybe interpreted as an illegal mark by Python interpreter in the recent version, as in the example in Python:
fred$ = ‘alex’
SyntaxError: invalid syntax
I really not use this above syntax, otherwise, the properly $text to text variable in the text fields.
I tried to install older versions, within and without virtual environments, and the same crash appears again. I use Ubuntu 20.04 with Psychopy 2021.2.3.
Dear all,
I personally resolve this task once creating the experiment in the builder, insert the variables in the text field with space before, and, modified the variables directly in Python code, removing the dollar sign.
The experiment runs perfectly.
I am having the same problem. Cannot figure out how to manage with it.
Unfortunately I have to check when I’ll comme back to lab. But the funny thing is that before we fixed a computer isuue, it worked great.
By the way, may I just ask how you managed to fix the problem?
Let’s say you are using Ubuntu (or some other Linux distribution) and an older version of Psychopy (the current version is 2022.1.4).
Psychopy 2022.1.4 does not have this issue. Thus, if that is an option to you, consider upgrading.
I’ve written a tutorial on how to install Psychopy 2022.1.4 in Ubuntu 22.04 using virtualenv that might help.
Nevertheless, if you choose to stay with the same Psychopy version (again, assuming that this is your case), you can modify the contents of the file paramCtrls.py
(usually installed under home/user/.local/lib/python3.8/site-packages/psychopy/app/builder/dialogs/paramCtrls.py). The modification needed is described here.
If you are not familiarized with the notation used there: the signs indicate one line to delete (-) and two lines to insert (+), with one of them commented (# in the beginning of the line). Save the file and you are good to go
Please, post here if you manage to solve the problem you’ve been having.
Best regards,
Flavio
Thank you so much for your detailed answer. I’ll text you on Monday and I’ll let you know about some details.
Have a nice weekend
The version that I am using is v2022.2.4. Do you think I can follow your suggestion as well? I can add that the OS is kubuntu 20.04
Hi @Airt78
Thanks for posting the version of Psychopy you are using.
I upgraded my installation to version 2022.2.4 and was able to replicate the error you are experiencing (Psychopy crashes) in my Ubuntu 22.04. So, somehow, this bug found its way back
Well, the paramsCtrl.py file is different in this version (compared to the one I pointed you to above) but the error, apparently, has the same culprit.
The good news is that I could get rid of it by commenting lines 56 to 66.
The print below shows how my paramsCtrl.py file looks like now:
Although it solves the problem, it is not an elegant / proper solution, but a workaround. @Becca, could you, please, notify someone who could take a look at this?
@Airt78, please, let me know if you can stop PsychoPy from crashing using this workaround.
Best regards,
Flavio
Thank you so much, @bastosfh . So the thing that I should do is just to comment to the file of paramsCtrl.py, shouldn’t I? May I ask how you opened this file on Ubuntu? Did you use the command prompt?
Yes, you just need to edit and save the file using any text editor.
You can do this via terminal or using your file manager (I believe Kubuntu uses Dolphin by default).
Using the terminal, you can open paramsCtrl.py
using any text editor (gedit, kate, etc.), as long as you know the path to the file (i.e. its location). If you know where your Psychopy files are, paramCtrls.py
can be found under /lib/python3.8/site-packages/psychopy/app/builder/dialogs/paramCtrls.py
So, for instance, you can open paramCtrls.py
using gedit by typing in the terminal:
gedit path_to_your_psychopy_instalation/lib/python3.8/site-packages/psychopy/app/builder/dialogs/paramCtrls.py
But, if you prefer, you can also locate paramCtrls.py
using Dolphin (or Nautilus / Gnome Files) and open it with your text editor (e.g. kate or gedit).
Best regards,
Flavio
Hello @bastosfh. Thank you so much for your suggestion. I would like to ask if by using the code you have mentioned here, this might be the expected output.
If so, which are the following steps?
No. The empty file indicates that your paramCtrls.py is not in the same path as mine.
Use your file manager to locate the file → right click on it → “open with” kate (or any other text editor you have installed).
Many thanks for replying me back. As far as I can see from the path (whose I am sharing the pic) there is no ‘dist-packages’ folder by following the path where the final one I am looking for is located. I found this ‘dist-packages’ just into with the folder called ‘python’, but once opened, cannot found the rest. Do you think this might depend on some updates? Which would recommend.
Thanks
Hello. I managed to open the file (finally) with Kate. Actually if you had a look to my previous post, the real message that popped up was:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/psychopy/app/builder/dialogs/paramCtrls.py", line 31, in validate
validate(self, self.valType)
File "/usr/local/lib/python3.8/dist-packages/psychopy/app/builder/dialogs/paramCtrls.py", line 557, in validate
if re.findall(r"(?<!\\)\"", val):
File "/usr/lib/python3.8/re.py", line 241, in findall
return _compile(pattern, flags).findall(string)
File "/usr/lib/python3.8/re.py", line 291, in _compile
Do you think I should make commented the same lines as you did? I am asking because by commenting those lines, it returns the same error.
How did you install Psychopy?
Could you upload here your commented paramsCtrl.py?
What was the issue you fixed (see quote below) and what did you do to fix it?
Would it be possible for you to start fresh (reinstall Kubuntu and Psychopy)?
Hi, the solution by @ bastosfh works. Checked on Kubuntu 20.04, psychopy 2022.2.2. Thank you.