KxSystems / pyq

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

Running pyq in terminal resulting in exit .pyq.run line of code executing from python.q file #144

Closed stephenc-ie closed 2 years ago

stephenc-ie commented 2 years ago

Questions

Steps to reproduce the issue

Expected result

Expected q/python interactive session in terminal

Actual result

(virtualenv) pi@raspberrypi:~/virtualenv $ pyq

  [2]  /home/pi/virtualenv/q/python.q:9: if[`python.q~last` vs hsym .z.f;exit .pyq.run .pyq.args]
                                                                                                                ^

Arrow ^ points to exit .pyq.run. Any ideas what to try from that point? What may have gone wrong on install process? Any suggestions very welcome - or if any Rasp Pi install guides available please share

Q works in terminal on my virtual environment. Python version 3.7.3 pyq 5.0.0 installed using pip

Workaround

If you know workaround, please provide it here.

sashkab commented 2 years ago

I don't think PyQ was ever tested on Raspberry Pi. Could you please provide output of pip install pyq in clean venv?

stephenc-ie commented 2 years ago

Hi sashkab, sure attached images. If it hasn't been tested on raspberry pi i can try alternative method following guide for setup - but was hoping to get this working. If nothing obvious I done wrong then no worries

Sure image image

sashkab commented 2 years ago
sashkab commented 2 years ago

I have 64-bit debian ubuntu on raspberry pi 4 and here is how I got it working:

ubuntu@pi4 ~ $ python3.8 -mvenv .virtualenvs/pyq
ubuntu@pi4 ~ $ source .virtualenvs/pyq/bin/activate
(pyq) ubuntu@pi4 ~ $ export QLIC=$HOME/.lic
(pyq) ubuntu@pi4 ~ $ unzip ~/l64arm.zip -d $VIRTUAL_ENV/q
(pyq) ubuntu@pi4 ~ $ ln -s l64arm $VIRTUAL_ENV/q/l32
(pyq) ubuntu@pi4 ~ $ ln -s l64arm $VIRTUAL_ENV/q/l64
(pyq) ubuntu@pi4 ~ $ pyq --versions
PyQ 5.0.0
KDB+ 4.1 (2021.07.12) l64
Python 3.8.10 (default, Jun  2 2021, 10:49:15)
[GCC 9.4.0]

Basically, workaround is mostly pointing l32 and l64 directories to l64arm directory. As raspberry pi is not supported platform, this is best I can come up with.

If you have 32-bit kdb+ binary and 32-bit os, perhaps some other links needs to be created -- please provide output of the ls $VIRTUAL_ENV/q command so I could suggest.

Please note, running 32-bit kdb+ on 64-bit os is not supported (well, you can, most likely compile python as 32-bit binary and try, but I would not able to help you with this endeavor.

stephenc-ie commented 2 years ago

Thanks for above suggestion and resolution sashkab. I am getting access to existing work dev server so won't be pursuing further at this moment on my RPi 3.