gui.DlgFromDict hangs, no dialog appears


I am running psychopy 2021.2.3 in a conda environment on a MacBook Pro (intel chip i7) with Big Sur. When I run the following

from psychopy import gui
dlg = gui.DlgFromDict({'One Item': False, 'Two Items': True})

it just hangs, and no dialog box appears.

The solution suggested here gui.DlgFromDict never returns does not work for me. I installed pyqt 5.12.3 in the environment but I get the same error.

If anyone could help, I would very much appreciate it.


Hi Sarah, sorry to hear this! does that code run in the code window of psychopy standalone? (it ran for me from standalone on w windows) - this might help pin down if the issue is with the pyton environment or the system.


Hi Becca,

Thanks for your help. I ran the code in standalone PsychoPy 2021.2.3 and it worked properly. So it does appear the be the conda environment. I set up the environment using the psychopy environment file (Installation — PsychoPy v2021.2) and later ran pip install PyQt5 hoping it would fix this issue. Below is a list of packages installed in my conda environment, but I’m not sure how to get a similar list for the standalone PsychoPy to compare.


# Name                    Version                   Build  Channel
aom                       3.2.0                he49afe7_2    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
arabic_reshaper           2.1.3              pyhd8ed1ab_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.lzma            0.0.14           py36hcf28acf_3    conda-forge
blosc                     1.21.0               he49afe7_0    conda-forge
brotlipy                  0.7.0           py36hfa26744_1001    conda-forge
bzip2                     1.0.8                h0d85af4_4    conda-forge
c-ares                    1.18.1               h0d85af4_0    conda-forge
ca-certificates           2021.10.8            h033912b_0    conda-forge
cairo                     1.16.0            he43a7df_1008    conda-forge
certifi                   2021.5.30        py36h79c6626_0    conda-forge
cffi                      1.14.6           py36hbc36220_1    conda-forge
charset-normalizer        2.0.8              pyhd8ed1ab_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
configobj                 5.0.6                      py_0    conda-forge
configparser              5.1.0              pyhd8ed1ab_0    conda-forge
cryptography              35.0.0           py36ha6a00b0_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
dbus                      1.13.6               ha13b53f_2    conda-forge
decorator                 4.4.2                      py_0    conda-forge
dukpy                     0.2.3            py36hfa26744_1    conda-forge
esprima-python            4.0.1                   py_2001    conda-forge
et_xmlfile                1.0.1                   py_1001    conda-forge
expat                     2.4.1                he49afe7_0    conda-forge
ffmpeg                    4.4.1                h79e7b16_0    conda-forge
fontconfig                2.13.1            h10f422b_1005    conda-forge
freetype                  2.10.4               h4cff582_1    conda-forge
freetype-py               2.2.0              pyh9f0ad1d_0    conda-forge
future                    0.18.2           py36h79c6626_3    conda-forge
gettext                   hd1a6beb_1008    conda-forge
gevent                    21.8.0           py36hfa26744_0    conda-forge
gitdb                     4.0.9              pyhd8ed1ab_0    conda-forge
gitpython                 3.1.18             pyhd8ed1ab_0    conda-forge
glfw                      3.3.5                h0d85af4_0    conda-forge
glib                      2.70.1               hcf210ce_0    conda-forge
glib-tools                2.70.1               hcf210ce_0    conda-forge
gmp                       6.2.1                h2e338ed_0    conda-forge
gnutls                    3.6.13               h756fd2b_1    conda-forge
graphite2                 1.3.13            h2e338ed_1001    conda-forge
greenlet                  1.1.2            py36hefe7e0e_0    conda-forge
harfbuzz                  2.9.1                h159f659_1    conda-forge
hdf5                      1.12.1          nompi_h2f0ef1a_102    conda-forge
icu                       68.2                 he49afe7_0    conda-forge
idna                      3.1                pyhd3deb0d_0    conda-forge
imageio                   2.9.0                      py_0    conda-forge
imageio-ffmpeg            0.4.5              pyhd8ed1ab_0    conda-forge
jasper                    1.900.1           h636a363_1006    conda-forge
javascripthon             0.11                       py_0    conda-forge
jbig                      2.1               h0d85af4_2003    conda-forge
jpeg                      9d                   hbcb3906_0    conda-forge
json_tricks               3.15.5             pyhd8ed1ab_0    conda-forge
kiwisolver                1.3.1            py36hc61eee1_1    conda-forge
krb5                      1.19.2               hcfbf3a7_3    conda-forge
lame                      3.100             h35c211d_1001    conda-forge
lcms2                     2.12                 h577c468_0    conda-forge
lerc                      3.0                  he49afe7_0    conda-forge
libblas                   3.9.0           12_osx64_openblas    conda-forge
libcblas                  3.9.0           12_osx64_openblas    conda-forge
libclang                  11.1.0          default_he082bbe_1    conda-forge
libcurl                   7.80.0               hf45b732_0    conda-forge
libcxx                    12.0.1               habf9029_0    conda-forge
libdeflate                1.8                  h0d85af4_0    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 haf1e3a3_1    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libflac                   1.3.3                h046ec9c_1    conda-forge
libgfortran               5.0.0           9_3_0_h6c81a4c_23    conda-forge
libgfortran5              9.3.0               h6c81a4c_23    conda-forge
libglib                   2.70.1               hf1fb8c0_0    conda-forge
libiconv                  1.16                 haf1e3a3_0    conda-forge
liblapack                 3.9.0           12_osx64_openblas    conda-forge
liblapacke                3.9.0           12_osx64_openblas    conda-forge
libllvm11                 11.1.0               hd011deb_2    conda-forge
libnghttp2                1.43.0               h6f36284_1    conda-forge
libogg                    1.3.4                h35c211d_1    conda-forge
libopenblas               0.3.18          openmp_h3351f45_0    conda-forge
libopencv                 4.5.3            py36hc0bd43f_2    conda-forge
libopus                   1.3.1                hc929b4f_1    conda-forge
libpng                    1.6.37               h7cec526_2    conda-forge
libpq                     13.5                 hea3049e_0    conda-forge
libprotobuf               3.16.0               hcf210ce_0    conda-forge
libsndfile                1.0.31               he49afe7_1    conda-forge
libsodium                 1.0.18               hbcb3906_1    conda-forge
libssh2                   1.10.0               h52ee1ee_2    conda-forge
libtiff                   4.3.0                hd146c10_2    conda-forge
libuv                     1.42.0               h0d85af4_0    conda-forge
libvorbis                 1.3.7                h046ec9c_0    conda-forge
libvpx                    1.11.0               he49afe7_3    conda-forge
libwebp-base              1.2.1                h0d85af4_0    conda-forge
libxml2                   2.9.12               h93ec3fd_0    conda-forge
libzlib                   1.2.11            h9173be1_1013    conda-forge
llvm-openmp               12.0.1               hda6cdc1_1    conda-forge
lz4-c                     1.9.3                he49afe7_1    conda-forge
macropy3                  1.1.0b2                    py_0    conda-forge
matplotlib                3.3.4            py36h79c6626_0    conda-forge
matplotlib-base           3.3.4            py36h4ea959b_0    conda-forge
mock                      4.0.3            py36h79c6626_1    conda-forge
moviepy                   1.0.1                      py_0    conda-forge
msgpack-numpy               pyh9f0ad1d_0    conda-forge
msgpack-python            1.0.2            py36hc61eee1_1    conda-forge
mysql-common              8.0.27               h694c41f_1    conda-forge
mysql-libs                8.0.27               h115446f_1    conda-forge
ncurses                   6.2                  h2e338ed_4    conda-forge
nettle                    3.6                  hedd7734_0    conda-forge
nspr                      4.32                 hcd9eead_1    conda-forge
nss                       3.72                 h31e2bf1_0    conda-forge
numexpr                   2.7.3            py36he43235d_0    conda-forge
numpy                     1.19.5           py36h08b5fde_2    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
opencv                    4.5.3            py36h79c6626_2    conda-forge
openh264                  2.1.1                hfd3ada9_0    conda-forge
openjpeg                  2.4.0                h6e7aa92_1    conda-forge
openpyxl                  3.0.9              pyhd8ed1ab_0    conda-forge
openssl                   1.1.1l               h0d85af4_0    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pandas                    1.1.5            py36h2be6da3_0    conda-forge
pathlib2                  2.3.6            py36h79c6626_0    conda-forge
pcre                      8.45                 he49afe7_0    conda-forge
pillow                    8.3.2            py36h950f3bb_0    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               hbcb3906_0    conda-forge
portaudio                 19.6.0               he49afe7_4    conda-forge
proglog                   0.1.9                      py_0    conda-forge
psutil                    5.8.0            py36hfa26744_1    conda-forge
psychopy                  2021.2.3         py36h79c6626_0    conda-forge
psychtoolbox                     pypi_0    pypi
pthread-stubs             0.4               hc929b4f_1001    conda-forge
py-opencv                 4.5.3            py36h5954240_2    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pygame                    2.1.0                    pypi_0    pypi
pyglet                    1.5.16           py36h79c6626_0    conda-forge
pyglfw                    2.3.0            py36h79c6626_0    conda-forge
pyo                       1.0.4                    pypi_0    pypi
pyobjc-core               7.3              py36hfa26744_2    conda-forge
pyobjc-framework-cocoa    7.3              py36h79c6626_0    conda-forge
pyobjc-framework-quartz   7.3              py36h79c6626_0    conda-forge
pyopengl                  3.1.5                      py_0    conda-forge
pyopenssl                 21.0.0             pyhd8ed1ab_0    conda-forge
pyosf                     1.0.5                      py_2    conda-forge
pyparallel                0.2.2                    pypi_0    pypi
pyparsing                 3.0.6              pyhd8ed1ab_0    conda-forge
pypubsub                  4.0.3                      py_0    conda-forge
pyqmix                    2021.1.2         py36h79c6626_0    conda-forge
pyqt                      5.12.3           py36h79c6626_7    conda-forge
pyqt-impl                 5.12.3           py36hb40023b_7    conda-forge
pyqt5-sip                 4.19.18          py36h3ffa6ac_7    conda-forge
pyqtchart                 5.12             py36hb40023b_7    conda-forge
pyqtwebengine             5.12.1           py36hb40023b_7    conda-forge
pyserial                  3.5                pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1            py36h79c6626_3    conda-forge
pysoundfile               0.10.3.post1       pyhd3deb0d_0    conda-forge
pytables                  3.6.1            py36h044f1d5_4    conda-forge
python                    3.6.13          haf480d7_2_cpython    conda-forge
python-bidi               0.4.2                      py_0    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-gitlab             2.10.1             pyhd8ed1ab_0    conda-forge
python-sounddevice        0.4.1              pyh9f0ad1d_0    conda-forge                1.3              py36hfa26744_5    conda-forge
python_abi                3.6                     2_cp36m    conda-forge
pytz                      2021.3             pyhd8ed1ab_0    conda-forge
pyyaml                    5.4.1            py36hfa26744_1    conda-forge
pyzmq                     22.3.0           py36h50cd92c_0    conda-forge
qt                        5.12.9               h126340a_4    conda-forge
questplus                 2019.4                     py_0    conda-forge
readline                  8.1                  h05e3726_0    conda-forge
requests                  2.26.0             pyhd8ed1ab_1    conda-forge
requests-toolbelt         0.9.1                      py_0    conda-forge
ruamel.yaml               0.17.16          py36hfa26744_0    conda-forge
ruamel.yaml.clib          0.2.2            py36h20b66c6_2    conda-forge
scipy                     1.5.3            py36h4f136de_1    conda-forge
setuptools                58.0.4           py36h79c6626_2    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smmap                     3.0.5              pyh44b312d_0    conda-forge
sqlite                    3.37.0               h23a322b_0    conda-forge
svt-av1                   0.8.7                he49afe7_1    conda-forge
tk                        8.6.11               h5dbffcc_1    conda-forge
tornado                   6.1              py36hfa26744_1    conda-forge
tqdm                      4.62.3             pyhd8ed1ab_0    conda-forge
typing_extensions         4.0.0              pyha770c72_0    conda-forge
urllib3                   1.26.7             pyhd8ed1ab_0    conda-forge
webassets                 2.0                        py_0    conda-forge
websocket-client          1.2.1                    pypi_0    pypi
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
wxpython                  4.0.6            py36h1cd7e00_1    conda-forge
x264                      1!161.3030           h0d85af4_1    conda-forge
x265                      3.5                  h940c156_1    conda-forge
xarray                    0.18.2             pyhd8ed1ab_0    conda-forge
xlrd                      2.0.1              pyhd8ed1ab_3    conda-forge
xz                        5.2.5                haf1e3a3_1    conda-forge
yaml                      0.2.5                haf1e3a3_0    conda-forge
zeromq                    4.3.4                he49afe7_1    conda-forge
zlib                      1.2.11            h9173be1_1013    conda-forge
zope.event                4.5.0              pyh9f0ad1d_0    conda-forge
zope.interface            5.4.0            py36hfa26744_0    conda-forge
zstd                      1.5.0                h582d3a0_0    conda-forge

I still have not managed to solve this problem. If anyone has any advice I would greatly appreciate it.

Hi Sarah,

If it ran from PsychoPy standalone is there a specific reason to use the conda environment instead of launching the study from PsychoPy coder ?


Hi Becca,

Thanks for your reply!

Yes, two reasons:

  1. The Psychopy IDE is horrible, I prefer to use PyCharm.
  2. I need to install other packages not included in psychopy for my projects.

I’m open to other solutions that don’t involve a conda environment. I read this article (一、psychopy简介 - 知乎) on using PyCharm with the standalone PsychoPy installation, which would at least address 1 (but not 2?), but the article is for Windows and I was unable to reproduce a similar result for Mac OS.

I should mention that my projects are working fine on Windows machines with this setup, I only seem to encounter this on my macbook.


This seems to have been solved by running:

> conda install

From Running PsychoPy using Anaconda/Mac where this solution was proposed for a different problem, which i also had but didn’t care about. But I wondered if it would also solve my problem and it did.