DlgFromDict function throwing error

Hi all,

I am trying to run another lab’s script on my laptop, and everything works but the DlgFromDict() function (or any Dlg function). In other words, if I comment out these lines the actual experiment works just fine.

 dlg = gui.DlgFromDict(expInfo, title='Audio-visual Flashlag', fixed=['dateStr'])
 if dlg.OK:
     toFile('lastParams.pickle', expInfo)  # save params to file for next time
 else:
     core.quit()  # the user hit cancel so exit

If I do not comment these lines (and a few more that reference them), a brief psychopy window opens before crashing almost immediately. I have tried running the script from both PyCharm and from the terminal and I get the same error message. Details posted below. Any help would be greatly appreciated.

My Versions:
OSX: 10.14.2 (Mojave)
PsychoPy 1.90.3
Conda 4.6.8
Python 2.7.15 (running in its own conda environment because it’s python 2)

Note: I also have a separate environment for Psychopy3 and the DlgFromDict() function works perfectly. Does this suggest it’s a package issue? How would I narrow which one?

The full error message:

2019-04-12 10:21:22.522 python[10615:1823328] -[NSApplication transformToForegroundApplication]: unrecognized selector sent to instance 0x7f97be805df0
2019-04-12 10:21:22.524 python[10615:1823328] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication transformToForegroundApplication]: unrecognized selector sent to instance 0x7f97be805df0'
 First throw call stack:
(
	0   CoreFoundation                      0x00007fff2cf20ff5 __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff59078efb objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff2cf9ecc5 -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x00007fff2cec28ae ___forwarding___ + 1468
	4   CoreFoundation                      0x00007fff2cec2268 _CF_forwarding_prep_0 + 120
	5   libwx_osx_cocoau_core-3.0.0.4.0.dylib 0x000000131f0cb43e _ZN5wxApp9DoInitGuiEv + 478
	6   _core.so                            0x000000131e90974e _ZN10sipwxPyApp9OnInitGuiEv + 110
	7   libwx_osx_cocoau_core-3.0.0.4.0.dylib 0x000000131f11ae62 _ZN5wxApp10InitializeERiPPw + 242
	8   libwx_baseu-3.0.0.4.0.dylib         0x000000131f6d8e53 _Z12wxEntryStartRiPPw + 179
	9   libwx_baseu-3.0.0.4.0.dylib         0x000000131f6d9370 _Z12wxEntryStartRiPPc + 32
	10  _core.so                            0x000000131e908cfa _ZN7wxPyApp13_BootstrapAppEv + 442
	11  _core.so                            0x000000131e90d732 _ZL26meth_wxPyApp__BootstrapAppP7_objectS0_ + 114
	12  libpython2.7.dylib                  0x00000001090484e4 PyEval_EvalFrameEx + 22980
	13  libpython2.7.dylib                  0x00000001090428c4 PyEval_EvalCodeEx + 2164
	14  libpython2.7.dylib                  0x0000000108fc4723 function_call + 355
	15  libpython2.7.dylib                  0x0000000108f9bc55 PyObject_Call + 101
	16  libpython2.7.dylib                  0x0000000108fab032 instancemethod_call + 162
	17  libpython2.7.dylib                  0x0000000108f9bc55 PyObject_Call + 101
	18  libpython2.7.dylib                  0x0000000108ffecdf slot_tp_init + 175
	19  libpython2.7.dylib                  0x0000000108ffaba9 type_call + 313
	20  libpython2.7.dylib                  0x0000000108f9bc55 PyObject_Call + 101
	21  libpython2.7.dylib                  0x0000000109048168 PyEval_EvalFrameEx + 22088
	22  libpython2.7.dylib                  0x00000001090428c4 PyEval_EvalCodeEx + 2164
	23  libpython2.7.dylib                  0x000000010904cc0d fast_function + 109
	24  libpython2.7.dylib                  0x0000000109047f89 PyEval_EvalFrameEx + 21609
	25  libpython2.7.dylib                  0x00000001090428c4 PyEval_EvalCodeEx + 2164
	26  libpython2.7.dylib                  0x000000010904cc0d fast_function + 109
	27  libpython2.7.dylib                  0x0000000109047f89 PyEval_EvalFrameEx + 21609
	28  libpython2.7.dylib                  0x00000001090428c4 PyEval_EvalCodeEx + 2164
	29  libpython2.7.dylib                  0x0000000108fc4723 function_call + 355
	30  libpython2.7.dylib                  0x0000000108f9bc55 PyObject_Call + 101
	31  libpython2.7.dylib                  0x0000000108fab032 instancemethod_call + 162
	32  libpython2.7.dylib                  0x0000000108f9bc55 PyObject_Call + 101
	33  libpython2.7.dylib                  0x0000000108ffecdf slot_tp_init + 175
	34  libpython2.7.dylib                  0x0000000108ffaba9 type_call + 313
	35  libpython2.7.dylib                  0x0000000108f9bc55 PyObject_Call + 101
	36  libpython2.7.dylib                  0x0000000109048168 PyEval_EvalFrameEx + 22088
	37  libpython2.7.dylib                  0x00000001090428c4 PyEval_EvalCodeEx + 2164
	38  libpython2.7.dylib                  0x0000000109042042 PyEval_EvalCode + 34
	39  libpython2.7.dylib                  0x000000010906fa7d PyRun_FileExFlags + 157
	40  libpython2.7.dylib                  0x000000010906f5c0 PyRun_SimpleFileExFlags + 816
	41  libpython2.7.dylib                  0x0000000109086452 Py_Main + 3506
	42  libdyld.dylib                       0x00007fff5a13fed9 start + 1
	43  ???                                 0x0000000000000002 0x0 + 2
)
Abort trap: 6

Versions/Dependencies (these were sent in a requirements.txt pip file):

asn1crypto                0.24.0                   py27_0  
backports                 1.0                      py27_1  
backports.functools_lru_cache 1.5                      py27_1  
backports.lzma            0.0.13           py27hd0afa68_0  
backports_abc             0.5              py27h6972548_0  
blas                      1.0                         mkl  
blosc                     1.15.0               hd9629dc_0  
bzip2                     1.0.6                h1de35cc_5  
ca-certificates           2019.1.23                     0  
certifi                   2019.3.9                 py27_0  
cffi                      1.11.5           py27h6174b99_1  
chardet                   3.0.4                    py27_1  
cmake                     3.12.0               haff7e42_0  
configobj                 5.0.6                    py27_1  
cryptography              2.2.2            py27h1de35cc_0  
cycler                    0.10.0           py27hfc73c78_0  
cython                    0.29.6           py27h0a44026_0  
decorator                 4.3.0                    py27_0  
enum34                    1.1.6                    py27_1  
et_xmlfile                1.0.1            py27hc42f929_0  
expat                     2.2.6                h0a44026_0  
expyriment                0.9.0                    pypi_0    pypi
ffmpeg                    4.1               heb45b42_1002    conda-forge
freetype                  2.9.1                hb4e5f40_0  
funcsigs                  1.0.2                    pypi_0    pypi
functools32               3.2.3.2                  py27_1  
future                    0.16.0                   py27_2  
futures                   3.2.0                    py27_0  
gettext                   0.19.8.1             h15daf44_3  
gevent                    1.3.2.post0      py27h1de35cc_0  
gitdb2                    2.0.5                    py27_0  
gitpython                 2.1.11                   py27_0  
gmp                       6.1.2             h0a44026_1000    conda-forge
gnutls                    3.6.5             h53004b3_1002    conda-forge
greenlet                  0.4.13           py27h1de35cc_0  
hdf5                      1.10.4               hfa1e0ec_0  
icu                       58.2                 h4b95b61_1  
idna                      2.6              py27hedea723_1  
imageio                   2.3.0                    py27_0  
intel-openmp              2019.1                      144  
ipaddress                 1.0.22                   py27_0  
jdcal                     1.4                      py27_0  
jpeg                      9b                   he5867d9_2  
json-tricks               3.12.1                   pypi_0    pypi
kiwisolver                1.0.1            py27h0a44026_0  
krb5                      1.16.1               h24a3359_6  
lame                      3.100             h1de35cc_1001    conda-forge
libcurl                   7.61.1               hf30b1f0_0  
libcxx                    4.0.1                hcfea43d_1  
libcxxabi                 4.0.1                hcfea43d_1  
libedit                   3.1.20181209         hb402a30_0  
libffi                    3.2.1                h475c297_4  
libflac                   1.3.1             h0a44026_1002    conda-forge
libgfortran               3.0.1                h93005f0_2  
libiconv                  1.15                 hdd342a3_7  
libogg                    1.3.2             h1de35cc_1001    conda-forge
libpng                    1.6.36               ha441bb4_0  
libsndfile                1.0.28            h0a44026_1000    conda-forge
libsodium                 1.0.16               h3efe00b_0  
libssh2                   1.8.0                h322a93b_4  
libtiff                   4.0.10               hcb84e12_2  
libvorbis                 1.3.5             h1de35cc_1001    conda-forge
libxml2                   2.9.9                hab757c2_0  
libxslt                   1.1.33               h33a18ac_0  
lxml                      4.3.2            py27hef8c89e_0  
lzo                       2.10                 h362108e_2  
matplotlib                2.2.2            py27hbf02d85_2  
mkl                       2018.0.3                      1  
mkl_fft                   1.0.6            py27hb8a8100_0  
mkl_random                1.0.1            py27h5d10147_1  
mock                      2.0.0                    pypi_0    pypi
moviepy                   0.2.3.5                    py_0    conda-forge
msgpack-python            0.5.6                    pypi_0    pypi
multipledispatch          0.5.0                    py27_0  
ncurses                   6.1                  h0a44026_1  
nettle                    3.4.1             h3efe00b_1002    conda-forge
numexpr                   2.6.5            py27hf9f1f73_0  
numpy                     1.14.4           py27h9bb19eb_0  
numpy-base                1.14.4           py27ha9ae307_0  
olefile                   0.46                     py27_0  
openh264                  1.8.0             hd9629dc_1000    conda-forge
openpyxl                  2.5.4                    py27_0  
openssl                   1.0.2r               h1de35cc_0  
oset                      0.1.3                      py_1    conda-forge
pandas                    0.23.0           py27h1702cab_0  
patsy                     0.5.0                    py27_0  
pbr                       5.1.3                    pypi_0    pypi
pillow                    5.1.0            py27hb68e598_0  
pip                       18.1                     py27_0  
psutil                    5.4.6            py27h1de35cc_0  
psychopy                  1.90.3                   pypi_0    pypi
psychopy-ext              0.6.0.4                  pypi_0    pypi
pycparser                 2.18                     py27_1  
pygame                    1.9.3                    pypi_0    pypi
pyglet                    1.3.2                 py27_1000    conda-forge
pyobjc-core               5.1.2                    pypi_0    pypi
pyobjc-framework-cocoa    5.1.2                    pypi_0    pypi
pyobjc-framework-quartz   5.1.2                    pypi_0    pypi
pyopengl                  3.1.0                    pypi_0    pypi
pyopenssl                 18.0.0                   py27_0  
pyosf                     1.0.5                      py_2    conda-forge
pyparallel                0.2.2                    pypi_0    pypi
pyparsing                 2.2.0                    py27_1  
pyserial                  3.4                      py27_0  
pysocks                   1.6.8                    py27_0  
pysoundcard               0.5.2                    pypi_0    pypi
pysoundfile               0.10.1                     py_0    conda-forge
pytables                  3.5.1            py27h5bccee9_0  
python                    2.7.15               h138c1fe_0  
python-bidi               0.4.0                      py_1    conda-forge
python-dateutil           2.7.3                    py27_0  
python.app                2                        py27_9  
pytz                      2018.4                   py27_0  
pyyaml                    3.12             py27h1de35cc_1  
pyzmq                     17.0.0           py27h1de35cc_3  
readline                  7.0                  h1de35cc_5  
requests                  2.18.4           py27h9b2b37c_1  
rhash                     1.3.6                hdbc3d79_0  
scipy                     1.1.0            py27hf5b7bf4_0  
seaborn                   0.9.0                    py27_0  
setuptools                39.0.1                   py27_0  
singledispatch            3.4.0.3          py27he22c18d_0  
six                       1.11.0                   py27_1  
smmap2                    2.0.5                    py27_0  
snappy                    1.1.7                he62c110_3  
sounddevice               0.3.11                   pypi_0    pypi
soundfile                 0.10.2                   pypi_0    pypi
sqlite                    3.27.2               ha441bb4_0  
statsmodels               0.9.0            py27h1d22016_0  
subprocess32              3.5.3            py27h1de35cc_0  
tables                    3.5.1                    pypi_0    pypi
tk                        8.6.8                ha441bb4_0  
tornado                   5.1.1            py27h1de35cc_0  
tqdm                      4.23.4                   py27_0  
urllib3                   1.22             py27hc3787e9_0  
wheel                     0.31.1                   py27_0  
wxpython                  4.0.1            py27h8eb5bff_1  
x264                      1!152.20180806       h1de35cc_0    conda-forge
xlrd                      1.1.0                    py27_1  
xz                        5.2.4                h1de35cc_4  
yaml                      0.1.7                hc338f04_2  
zeromq                    4.2.5                h0a44026_1  
zlib                      1.2.11               h1de35cc_3  
zmq                       0.0.0                    pypi_0    pypi
zstd                      1.3.7                h5bba6e5_0  

Thanks!

I think you’re missing PyQt or have a broken version of it or something. By default the gui library uses QTgui, and I don’t see PyQt in the reqs list here. If it’s always crashing when trying to make a dialog, it’s either that Qt is crashing, or that it’s trying to use something other than Qt and that’s crashing. I honestly don’t know what the alternative is for the QT-based GUI.

Thanks! Installing PyQt fixed the issue - everything works great now.