| Reference | Downloads | Github

Psychopy3: wx clashes with pyglet

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 3.0.0b3
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?:
I used an old version of Psychopy (1.90.3) and it worked fine. But when I installed and tried to run a simple “Hello World” test on Psychopy Builder verson 3.0.0b3, there was an error:

“wx>=4.0 clashes with piglet and making it unsafe as a PsychoPy gui helper. Please install PyQt (4 or 5) or wxPython3 instead.”

I tried to install both PyQt 4 and wxPython3 but I still got this error.

Please help!

That’s weird. Standalone should be shipping pyqt and therefore avoiding any use of wx for dialogs. Is this the python 2 or python 3 version?

Is it a builder experiment you’re running or your own code? Ie. I’m wondering if you’ve forced import of wxgui rather than allowing psychopy you choose?

I have both python 2.7 and 3.7 but I am not sure which one psychopy is using. I am using builder and I am not sure how to check whether I forced import of wxgui or allowed psychopy to choose.

Having the same issue as Andrew with Standalone b3 running on the same OS. Tried to run the practical IAT demo, and got the same error message as above (I also get the same error when I try to run one of my own experiments). Especially weird because it’s running fine on a colleague’s laptop. There was also this additional output (if it’s of any use):

Traceback (most recent call last):
File “C:\Users\jcummins\Desktop\PsychoPy3 Demos\PsychoPy3 Demos\practical IAT\”, line 31, in
dlg = gui.DlgFromDict(dictionary=expInfo, title=expName)

File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\gui\”, line 292, in init

File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\gui\”, line 77, in init
app = ensureWxApp()

File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\gui\”, line 36, in ensureWxApp
raise Exception("wx>=4.0 clashes with pyglet and making it unsafe "

Exception: wx>=4.0 clashes with pyglet and making it unsafe as a PsychoPy gui helper. Please install PyQt (4 or 5) or wxPython3 instead.

Hope this additional info is useful! Cheers.

Thanks for your help debugging this. My best guess is that the Qt installations haven’t worked.
Could you open up the application, go to the shell (bottom of the Coder window) and type the following so we can see what happens when they try to load? Thanks

import PyQt5
import PyQt4

No worries, happy to help out. I think your guess is correct. I tried to import both, and each threw up these errors:

ImportError: No module named PyQt5 / ImportError: No module named PyQt4.

Hope that’s helpful!

OK, actually, yes, I think I’ve tracked this down

Ah, fantastic. Looking forward to hearing of the solution when you get it sorted. Thanks for your on-going work on this, and your responsiveness.

I’ve pushed a new version 3.0.0b4 that should fix this one

1 Like

Just wanted to say that I also got this error installing Psychopy 3.0.4 using Conda and Python 3.6. I solved it by adding pip install pyqt5 to the installation commands.