Closed xiangpeng2008 closed 4 years ago
It would be great if someone knows how to use pyq to run a script containing both python and q code, separated by q(). This solves my problem as well.
Unable to reproduce. Works as expected for me.
$ QHOME=$VIRTUAL_ENV/q $VIRTUAL_ENV/q/m64/q
q)p)print(1)
1
How did you get Python 3.7.6 onto you macOS? It is not standard on macOS 10.13.
Also, please provide output of the ls -la $VIRTUAL_ENV/q
and python3 -mpip list | grep pyq
.
@sashkab thanks a lot for your quick reply !
I don't remember exactly how I installed it, probably by brew
, which python version do you use ?
I just updated the outputs of the 2 commands, here's the screenshot.
Try running same command I did:
QHOME=$VIRTUAL_ENV/q $VIRTUAL_ENV/q/m64/q
And let me know if that works. Otherwise, I'd suggest to:
Run brew upgrade
.
Re-create new virtual env:
cd ~
python3.7 -mvenv pyq
source pyq/bin/activate
mkdir $VIRTUAL_ENV/q
unzip path/to/kdb.zip -d $VIRTUAL_ENV/q
python3.7 -mpip install pyq
Re-run your commands:
pyq --versions
QHOME=$VIRTUAL_ENV/q $VIRTUAL_ENV/q/m64/q
Hi @sashkab ,
QHOME=$VIRTUAL_ENV/q $VIRTUAL_ENV/q/m64/q
doesn't work.
But the brew upgrade
and re-create virtual env solves the problem perfectly !
Thanks a lot !
Questions
[x] Which operating system are you using (if Linux, please provide flavour of it, i.e RedHat, CentOS or Ubuntu), is it 32-bit, or 64-bit?
macOS Catalina, 10.15.4, 65-bit
[x] Which version of PyQ are you running? Please provide output of
pyq --versions
, if PyQ isn't operational, please provide Python interpreter version and PyQ versionpython -V; python3 -V; pip list | grep pyq
:4.2.1
[x] Which version of kdb+ are you using, is it 32-bit or 64-bit?
3.6 64-bit
[ ] If on 64-bit, is your
QLIC
set? Please provide outputenv | grep QLIC
on linux/macOS, orset|grep QLIC
on Windows.yes, QLIC=/Users/xiangpeng/venv37/q
[x] Did you use virtual environment to install PyQ? If not, why?
[x] Where is your
QHOME
? Please provide outputenv | grep QHOME
on linux/macOS, orset|grep QHOME
on Windows. QHOME=/Users/xiangpeng/venv37/q[x] Do you use Conda? If so, what version?
no
ls -la $VIRTUAL_ENV/q
(venv37) iMac /Users/xiangpeng $ ls -la venv37/q total 136 drwxr-xr-x 14 xiangpeng staff 448B May 12 20:20 ./ drwxr-xr-x 13 xiangpeng staff 416B Apr 13 16:38 ../ -rw-r--r--@ 1 xiangpeng staff 3.2K May 11 23:28 README.txt -rw-r--r--@ 1 xiangpeng staff 366B May 11 23:28 kc.lic drwxr-xr-x 4 xiangpeng staff 128B May 12 20:20 m64/ -rw-r--r-- 1 xiangpeng staff 516B May 12 20:20 p.k -rw-r--r-- 1 xiangpeng staff 155B May 12 20:20 pyq-config.q -rw-r--r-- 1 xiangpeng staff 1.1K May 12 20:20 pyq-operators.q -rw-r--r-- 1 xiangpeng staff 32B May 11 23:28 pyq-print.q -rwxr-xr-x 1 xiangpeng staff 319B May 12 20:20 python.q* -rw-r--r--@ 1 xiangpeng staff 22K May 11 23:28 q.k -rw-r--r--@ 1 xiangpeng staff 5.3K May 11 23:28 s.k -rw-r--r--@ 1 xiangpeng staff 821B May 11 23:28 sp.q -rw-r--r--@ 1 xiangpeng staff 150B May 11 23:28 trade.qpython3 -mpip list | grep pyq
(venv37) iMac /Users/xiangpeng $ python3 -mpip list | grep pyq pyq 4.2.1Steps to reproduce the issue
/Users/xiangpeng/venv37/q q)p)1
Expected result
1
Actual result
Traceback (most recent call last): File "", line 1, in
ModuleNotFoundError: No module named 'pyq'
'python
Workaround
In the same time, "pyq" works perfectly.
If you know workaround, please provide it here. With help of @sashkab in https://github.com/KxSystems/pyq/issues/132#issuecomment-628620923, there's an issue lying python3.7, the workaround to downgrade python3.6 works perfectly.