psychopy.org | Reference | Downloads | Github

Recommendation for Debugging Psychopy code

Previously I’ve used Pycharm with a conda virtual environment as my primary IDE setup for debugging Psychopy scripts. With the transition to using wxPython, this setup throws an error when two dialogue boxes are created. For example,

from psychopy import gui

dlg1 = gui.Dlg(title='first dialogue box')
dlg1.show()

dlg2 = gui.Dlg(title='second dialogue box')
dlg2.show()

throws the error wx._core.PyNoAppError: The wx.App object must be created first!, when run using conda’s version of wxPython. This appears to primarily be a problem with conda’s version of wxPython (see this discussion thread – link).

It’s very important for me to keep my projects separated as I’m maintaining several ongoing experiments that all use different versions of Psychopy and Python. Having an interactive debugger is also an essential feature for me. I’d very much like to know what people are using right now to maintain their scripts and if anyone has a virtual environment/debugger configuration that works for them.

So what setups are folks using to maintain and debug their Psychopy v2021.1.4 scripts?

I haven’t used virtual environments when coding but personally I find the feedback of a syntax error in the JS side of an Auto translate code components helpful to keep my grammar and indentations in check.

1 Like