KxSystems / pyq

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

conda, installation order of PyQ and JupyterQ matters #97

Closed webradio closed 5 years ago

webradio commented 5 years ago

It looks similar to issue 30

Questions

embedpy                   1.3.1            py36h14c3975_0    kx
jupyterq                  1.1.4            py36h14c3975_0    kx
kdb                       3.6                  2018.10.23    kx
pyq                       4.1.4            py36h39e3cac_0    enlnt

no

Steps to reproduce the issue

conda install -c kx -c enlnt pyq jupyterq
jupyter notebook

In the browser window that opens, try creating a new Q notebook.

Expected result

Jupyter notebook launching Q kernel and connecting to it, so that I can enter and run e.g. til 2

Actual result

[I 16:13:18.993 NotebookApp] Kernel started: a0c4204f-97a2-4d09-b1d9-5ab694e99b88
'2018.12.06T16:13:19.453 .p.eval
  [4]  /home/user/anaconda3/q/jupyterq_pyzmq.q:2: pypop:.p.eval["list.pop"][;0]

Workaround

This worked:

conda uninstall pyq embedpy jupyterq kdb
conda install -c kx -c enlnt pyq
conda install -c kx jupyterq
jupyter notebook

When installed in this order, p.k is much shorter and only refers p.q. $QHOME/l64/p.so is much longer.

sashkab commented 5 years ago

In order to use PyQ in the jupyter notebook, you need to install PyQ kernel:

pip install pyq-kernel
pyq -mpyq.kernel install

Then you will able to start notebook with the PyQ-kernel:

In console:

jupyter console --kernel=pyq_3

Or start jupyter notebook and select PyQ 3 when creating a new notebook.

For issues with jupyterq, please report issues to the specific project -- https://github.com/KxSystems/jupyterq.

davidkell commented 5 years ago

Both pyq and embedpy both define a p.k (although the embedpy version is just \l p.q). This seems to be the source of the issue and explains why the installation order impacts whether jupyterq works.

Are there any plans to allow a user to run both the jupyterq and pyq kernels within the same python installation. From our experience they are both complementary, and seems a natural extension of https://github.com/KxSystems/embedPy/issues/17