BCDA-APS / use_bluesky

Tools to help APS use the Bluesky Framework (https://blueskyproject.io/)
8 stars 3 forks source link

RunEngine in jupyter-notebook raises RuntimeError #32

Closed prjemian closed 6 years ago

prjemian commented 6 years ago

During execution of RunEngine with a jupyter notebook, the first call with RE(some_plan()) raises a RuntimeError.

RuntimeError: This event loop is already running

See this notebook for the full trace: https://github.com/BCDA-APS/use_bluesky/blob/master/notebooks/lesson3.ipynb

@tacaswell, @danielballan : any thoughts on this? This is some configuration error with the Python installation, probably some library needs an update. I've got this same situation on at least two different workstations. list of installed packages follows:

mintadmin@mint-vm ~/.../use_bluesky/notebooks $ ~/Apps/BlueSky/bin/conda list
# packages in environment at /home/mintadmin/Apps/BlueSky:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.11                   py36_0  
amostra                   0.2              py36h7c5da53_0    lightsource2-tag
anaconda                  custom           py36hbbc8b67_0  
anaconda-client           1.6.14                   py36_0  
appdirs                   1.4.3            py36h28b3542_0  
APS-BlueSky-tools         0.0.27                    <pip>
asn1crypto                0.24.0                   py36_0  
astropy                   3.0.3            py36h14c3975_2  
atomicwrites              1.1.5                    py36_0  
attrs                     18.1.0                   py36_0  
attrs                     16.3.0                    <pip>
automat                   0.7.0                    py36_0  
babel                     2.6.0                    py36_0  
backcall                  0.1.0                    py36_0  
beautifulsoup4            4.6.0                    py36_1  
blas                      1.0                         mkl  
bleach                    2.1.3                    py36_0  
bluesky                   1.3.3                    py36_0    lightsource2-tag
bokeh                     0.13.0                   py36_0  
boltons                   17.1.0                    <pip>
boltons                   17.1.0                   py36_0    conda-forge
bottleneck                1.2.1            py36h035aef0_1  
ca-certificates           2018.4.16                     0    conda-forge
cairo                     1.14.8                        0  
certifi                   2018.4.16                py36_0  
cffi                      1.11.5           py36h9745a5d_0  
chardet                   3.0.4                    py36_1  
click                     6.7                      py36_0  
cloudpickle               0.5.3                    py36_0  
clyent                    1.2.2                    py36_1  
conda                     4.5.8                    py36_0  
conda-build               3.10.9                   py36_0  
conda-env                 2.6.0                         1  
conda-verify              3.0.0                    py36_0  
constantly                15.1.0           py36h28b3542_0  
coverage                  4.5.1            py36h14c3975_0  
coveralls                 1.2.0                     <pip>
cryptography              2.2.2            py36h14c3975_0  
curl                      7.60.0               h84994c4_0  
cycler                    0.10.0                   py36_0  
cython                    0.28.3           py36h14c3975_0  
cytoolz                   0.9.0.1          py36h14c3975_1  
dask                      0.18.1                   py36_0  
dask-core                 0.18.1                   py36_0  
databroker                0.11.1                   py36_0    lightsource2-tag
dbus                      1.10.20                       0  
decorator                 4.3.0                    py36_0  
dill                      0.2.8.2                  py36_0  
distributed               1.22.0                   py36_0  
docopt                    0.6.2                     <pip>
doct                      1.0.5                      py_0    conda-forge
doct                      1.0.0                     <pip>
docutils                  0.14                     py36_0  
entrypoints               0.2.3                    py36_2  
enum34                    1.1.6                     <pip>
epics-base                7.0.1.1                 pl526_1    sveseli
event-model               1.5.0                    py36_1    lightsource2-tag
expat                     2.2.5                he0dffb1_0  
fast-histogram            0.4              py36h035aef0_0  
fastcache                 1.0.2            py36h14c3975_2  
filelock                  3.0.4                    py36_0  
fisx                      1.1.4                     <pip>
fontconfig                2.12.1                        3  
freeglut                  3.0.0                hf484d3e_5  
freetype                  2.5.5                         2  
gettext                   0.19.8.1             hd7bead4_3  
git                       2.17.1          pl526hb37396a_0  
glib                      2.51.4                        0    lightsource2-tag
glob2                     0.6                      py36_0  
glue-core                 0.13.3                   py36_0  
glue-vispy-viewers        0.10                     py36_0  
glueviz                   0.13.3                        0  
gmp                       6.1.2                h6c8ec71_1  
gmpy2                     2.0.8            py36h10f8cd9_2  
gobject-introspection     1.51.3                   py36_0    lightsource2-tag
graphite2                 1.3.11               h16798f4_2  
gsl                       2.4                  h14c3975_4  
gst-plugins-base          1.8.0                         0  
gstreamer                 1.8.0                         0  
h5py                      2.8.0            py36h8d01980_0  
harfbuzz                  0.9.39                        2  
hdf5                      1.10.2               hba1933b_1  
heapdict                  1.0.0                    py36_2  
historydict               1.2.1            py36he166159_0    lightsource2-tag
hkl                       5.0.0.2173       py36h8be59e9_2    lightsource2-tag
hklpy                     0.3.11                   py36_1    lightsource2-tag
html5lib                  1.0.1                    py36_0  
humanize                  0.5.1                    py36_0    conda-forge
humanize                  0.5.1                     <pip>
hyperlink                 18.0.0                   py36_0  
hypothesis                3.59.1           py36h39e3cac_0  
icu                       54.1                          0  
idna                      2.7                      py36_0  
imageio                   2.3.0                    py36_0  
imagesize                 1.0.0                    py36_0  
incremental               17.5.0                   py36_0  
intel-openmp              2018.0.3                      0  
ipykernel                 4.8.2                    py36_0  
ipython                   6.4.0                    py36_1  
ipython_genutils          0.2.0                    py36_0  
ipywidgets                7.2.1                    py36_0  
jedi                      0.12.0                   py36_1  
jinja2                    2.10                     py36_0  
jpeg                      9b                   h024ee3a_2  
jsonschema                2.6.0                    py36_0  
jupyter_client            5.2.3                    py36_0  
jupyter_core              4.4.0                    py36_0  
libcurl                   7.60.0               h1ad7b7a_0  
libedit                   3.1.20170329         h6b74fdf_2  
libffi                    3.2.1                hd88cf55_4  
libgcc                    7.2.0                h69d50b8_2  
libgcc-ng                 7.2.0                hdf63c60_3  
libgfortran               3.0.0                         1  
libgfortran-ng            7.2.0                hdf63c60_3  
libiconv                  1.14                          4    conda-forge
libopenblas               0.2.20               h9ac9557_7  
libpng                    1.6.34               hb9fc6fc_0  
libsodium                 1.0.16               h1bed415_0  
libssh2                   1.8.0                h9cfc8f7_4  
libstdcxx-ng              7.2.0                hdf63c60_3  
libtiff                   4.0.9                he85c1e1_1  
libxcb                    1.13                 h1bed415_1  
libxml2                   2.9.4                         0  
libxslt                   1.1.29                        3    conda-forge
lmfit                     0.9.7                    py36_0    conda-forge
locket                    0.2.0                    py36_1  
lxml                      4.1.1            py36h4d89739_0  
markupsafe                1.0              py36h14c3975_1  
matplotlib                2.0.2               np112py36_0  
mistune                   0.8.3            py36h14c3975_1  
mkl                       2018.0.3                      1  
mongoquery                1.1.0                    py36_0    conda-forge
mongoquery                1.1.0                     <pip>
more-itertools            4.2.0                    py36_0  
mpc                       1.1.0                h10f8cd9_1  
mpfr                      4.0.1                hdf1c602_3  
mpl-scatter-density       0.3                      py36_0  
mpmath                    1.0.0                    py36_2  
msgpack-python            0.5.6            py36h6bb024c_0  
nbconvert                 5.3.1                    py36_0  
nbformat                  4.4.0                    py36_0  
ncurses                   6.1                  hf484d3e_0  
networkx                  2.1                      py36_0  
notebook                  5.6.0                    py36_0  
numpy                     1.12.1           py36he24570b_1  
olefile                   0.45.1                   py36_0  
openblas                  0.2.20                        4  
openblas-devel            0.2.20                        7  
openssl                   1.0.2o               h20670df_0  
ophyd                     1.2.0                    py36_0    lightsource2-tag
packaging                 17.1                     py36_0  
pandas                    0.23.3           py36h04863e7_0  
pandoc                    2.2.1                h629c226_0  
pandocfilters             1.4.2                    py36_1  
parso                     0.2.1                    py36_0  
partd                     0.3.8                    py36_0  
patchelf                  0.9                  hf484d3e_2  
patsy                     0.5.0                    py36_0  
pcre                      8.42                 h439df22_0  
perl                      5.26.2               h14c3975_0  
pexpect                   4.6.0                    py36_0  
pickleshare               0.7.4                    py36_0  
pillow                    4.2.1                    py36_0  
PIMS                      0.3.3                     <pip>
pims                      0.4.1                      py_1    conda-forge
pip                       18.0                      <pip>
pip                       10.0.1                   py36_0  
pixman                    0.34.0               hceecf20_3  
pkginfo                   1.4.2                    py36_1  
pkginfo                   1.4.1                     <pip>
plotly                    2.7.0                    py36_1  
pluggy                    0.6.0                    py36_0  
prettytable               0.7.2                    py36_0    conda-forge
prometheus_client         0.2.0                    py36_0  
prompt_toolkit            1.0.15                   py36_0  
psutil                    5.4.6            py36h14c3975_0  
ptyprocess                0.6.0                    py36_0  
pvapy                     1.2.0            py36h39e3cac_1    sveseli
pvapy-boost               1.67.0           py36h39e3cac_1    sveseli
pvapy-epics               7.0.1.1                 pl526_1    sveseli
py                        1.5.4                    py36_0  
pyasn1                    0.4.3                    py36_0  
pyasn1-modules            0.2.2                    py36_0  
pycairo                   1.13.3                   py36_0    lightsource2-tag
pycosat                   0.6.3            py36h14c3975_0  
pycparser                 2.18                     py36_1  
pydm                      1.3.0                    py36_0    pydm-tag
pyepics                   3.3.1                    py36_0    conda-forge
PyGithub                  1.35                      <pip>
pygments                  2.2.0                    py36_0  
pygobject3                3.18.2                   py36_2    lightsource2-tag
PyJWT                     1.5.3                     <pip>
pymongo                   3.7.0            py36h14c3975_0  
pympler                   0.5                      py36_0  
pyopengl                  3.1.1a1                  py36_0  
pyopenssl                 18.0.0                   py36_0  
pyparsing                 2.2.0                    py36_1  
pyqt                      5.6.0            py36h22d08a2_6  
pyqtgraph                 0.10.0           py36h28b3542_3  
pyRestTable               2017.2.0                  <pip>
pysocks                   1.6.8                    py36_0  
pytest                    3.6.2                    py36_0  
pytest-arraydiff          0.2              py36h39e3cac_0  
pytest-astropy            0.4.0                    py36_0  
pytest-doctestplus        0.1.3                    py36_0  
pytest-openfiles          0.3.0                    py36_0  
pytest-remotedata         0.3.0                    py36_0  
python                    3.6.6                hc3d631a_0  
python-dateutil           2.7.3                    py36_0  
pytz                      2018.5                   py36_0  
pywavelets                0.5.2            py36h035aef0_2  
pyyaml                    3.12             py36h14c3975_1  
pyzmq                     17.0.0           py36h14c3975_3  
qt                        5.6.2                         5  
qtconsole                 4.3.1                    py36_0  
qtpy                      1.4.2                    py36_1  
readline                  7.0                  ha6073c6_4  
requests                  2.19.1                   py36_0  
requests-toolbelt         0.8.0                     <pip>
rise                      5.0.0                    py36_0    damianavila82
ruamel_yaml               0.15.42          py36h14c3975_0  
scikit-image              0.13.1           py36h14c3975_1  
scipy                     1.1.0            py36hc49cb51_0  
seaborn                   0.8.1                    py36_0  
send2trash                1.5.0                    py36_0  
service_identity          17.0.0           py36h28b3542_0  
setuptools                39.2.0                   py36_0  
simplegeneric             0.8.1                    py36_2  
sip                       4.18.1           py36hf484d3e_2  
six                       1.11.0                   py36_1  
slicerator                0.9.8                     <pip>
slicerator                0.9.8                      py_1    conda-forge
snowballstemmer           1.2.1                    py36_0  
sortedcontainers          2.0.4                    py36_0  
spec2nexus                2017.901.4+10.g0ad8aa6           <pip>
sphinx                    1.7.5                    py36_0  
sphinx_rtd_theme          0.4.0                    py36_0  
sphinxcontrib             1.0                      py36_1  
sphinxcontrib-websupport  1.1.0                    py36_1  
sqlite                    3.24.0               h84994c4_0  
statsmodels               0.9.0            py36h035aef0_0  
suitcase                  0.7.0                    py36_0    lightsource2-tag
super-state-machine       2.0.1                     <pip>
super_state_machine       1.0              py36h7bccc9c_0    lightsource2-tag
sympy                     1.1.1                    py36_0  
tblib                     1.3.2                    py36_0  
terminado                 0.8.1                    py36_1  
testpath                  0.3.1                    py36_0  
tifffile                  0.10.0              np112py36_0    conda-forge
tk                        8.6.7                hc745277_3  
toolz                     0.9.0                    py36_0  
tornado                   5.0.2            py36h14c3975_0  
tqdm                      4.23.4                   py36_0  
traitlets                 4.3.2                    py36_0  
twine                     1.9.1                     <pip>
twisted                   18.4.0           py36h14c3975_0  
typhon                    0.2.0rc1                 py36_0    pcds-tag
typing                    3.6.4                    py36_0  
tzlocal                   1.5.1                    py36_0  
tzlocal                   1.3                       <pip>
ujson                     1.35             py36h14c3975_0  
urllib3                   1.23                     py36_0  
versioneer                0.18                      <pip>
wcwidth                   0.1.7                    py36_0  
webencodings              0.5.1                    py36_1  
wheel                     0.31.1                   py36_0  
widgetsnbextension        3.2.1                    py36_0  
xlrd                      1.1.0                    py36_1  
xz                        5.2.4                h14c3975_4  
yaml                      0.1.7                had09818_2  
zeromq                    4.2.5                hf484d3e_0  
zict                      0.1.3                    py36_0  
zlib                      1.2.11               ha838bed_2  
zope                      1.0                      py36_0  
zope.interface            4.5.0            py36h14c3975_0  
danielballan commented 6 years ago

You need to pin tornado to <5. This on my radar, hoping to get it done by end of August. https://github.com/NSLS-II/bluesky/issues/1062

prjemian commented 6 years ago

Thanks. I'm a noob. How do I pin tornado <5?

prjemian commented 6 years ago

This will set my installation right

conda install tornado<5

but how to keep it that way?

prjemian commented 6 years ago

er...

conda install tornado=4
prjemian commented 6 years ago

How to pin: http://www.damian.oquanta.info/posts/how-to-pin-conda.html

prjemian commented 6 years ago

Solved