KxSystems / pyq

PyQ — Python for kdb+
http://code.kx.com/q/interfaces
Apache License 2.0
190 stars 49 forks source link

Notebook cells don't run after first error until PyQ kernel restart #99

Closed webradio closed 5 years ago

webradio commented 5 years ago

This is a continuation of https://stackoverflow.com/questions/53739406/notebook-cells-dont-run-after-first-error-until-pyq-kernel-restart/53869615. pyq kernel 1.0.1 didn't help.

Questions

Steps to reproduce the issue

Create a fresh virtualenv:

conda update -n base -c defaults conda
conda create -n pyqtwo
source activate pyqtwo
conda install -c kx -c enlnt pyq
pip install pyq-kernel
# Placed kc.lic into /home/user/miniconda3/envs/pyqtwo/q/
conda install jupyter
pyq -m pyq.kernel install
jupyter kernelspec list
jupyter-notebook --debug

In the jupyter notebook, create a new one with PyQ 3 kernel. Run following cells:
from pyq import q; q('.z.ts') returns {@[i1;();::]}, seems to be pyq kernel 1.0.1, indeed;
nonexisting_function() returns an error;
6*7

Expected result

42

Actual result

Nothing. Notebook unresponsive until kernel restart. If, instead of restarting the kernel, I close the browser with the notebook and press Ctrl-C in the terminal where jupyter-notebook was started, it reports Kernel is taking too long to finish, killing. Both q and pyq run o.k. from a command line.

abalkin commented 5 years ago

This issue is caused by the changes introduced in ipykernel version 5. Downgrading to 4.10 fixes the problem:

pip install -U ipykernel==4.10
sashkab commented 5 years ago

We've release pyq-kernel 1.1, which should work with the latest version of the ipykernel. Please upgrade and try again.

pip install -U pyq-kernel
pyq -m pyq.kernel install