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.
Unfortunately, these fixes did not solve the problem for me on Ubuntu 22.04 using PsychoPy 2023.1.1
I’ve never tried this version of PsychoPy.
Nevertheless, I’ve just opened the current paramsCtrl.py on github and, if the bug is caused by the same feature, the workaround would be to comment lines 75 to 85:
Please, let me know if that works.
Best regards,
Flavio
Sorry, not sure where that file is located. Looked in home/user/.local/lib/python3.8/site-packages/psychopy/app/builder/dialogs/paramCtrls.py (with my “user”) but it’s not there. I did install Psychopy-2023.1.2.exe on my Ubuntu22.04 machine and ran it under Wine. Seems to run fine (no $var issues), although launching is slow (for splash, dialogs, and start of script) relative to linux. Not sure if that did anything to the .local files, but I doubt it. Still interested in using the linux version though if you have any thoughts of where the paramsCtrl.py file might be located.
Unless you are absolutely confident that you are getting reliable timing, I would really advise against using Wine in this case, since the “extra layer” could cause undesired / unpredictable delays. Have you considered installing PsychoPy “directly” on your Ubuntu using this tutorial (or any other you may find)?
About the location of paramsCtrl.py: I’ve never used Wine myself to install Psychopy-2023.1.2.exe
, so I don’t know where the .exe installer send it to. Have you tried searching for the file using Nautilus / Files?
I agree about the wine layer. Not my favorite choice, but I’ve got some commitments to deal with.
Yes, actually, I did see your post but didn’t work for me - After 50 million searches and installs I can’t remember what the specific problem was, but it didn’t solve it for me. However, it did motivate my own solution although that was before I ran into the $var problem. I was just happy PsychoPy launched and seemed to be functional.
Apparently, the 2023.1.1.zip and the 2023.1.1.tar.gz files on github extract as 2023.1.1, but the PsychoPy that launches is actually 2022.1.4. Which may have caused the original problems. I’ve now downloaded the 2023.1.2 and that’s the one that seemed to work – except for the $var problem. It’s so maddening because it only affects the text component – any other component (sound, movie, image) happily accepts $var. And, everything else runs as it should.
Re the paramsCtrl.py file I did do a global search and no luck. I will do another deep dive into the .wine directory and see if there’s anything there.
Commented out these lines, but same $var problem