I was wondering if anyone knows how to integrate pykx on the google cloud server for the advanced kdb exam, it doesnt seem to be on the list of available modules to import in python.
Thanks,
Matthew
I was wondering if anyone knows how to integrate pykx on the google cloud server for the advanced kdb exam, it doesnt seem to be on the list of available modules to import in python.
Thanks,
Matthew
https://code.kx.com/pykx/1.4/getting-started/installing.html
PyKX needs to be installed from the nexus.dl.kx.com repository
thanks for that, i dont think i have permissions to install this on the google cloud server though ,
This is being discussed with Matthew and handled by KX CMTP offline, i.e. making pykx available to everyone sitting Advanced KDB
as PyKX is open source in between, you don’t need access to KX Nexus repository anymore but could install under Linux with pip, see below my PyKX install from an Ubuntu gcp vm this morning
pip install pykx
https://code.kx.com/pykx/1.6/getting-started/installing.html
jlr@kx-csi-eval-gcp:~$ pip install --upgrade pip Collecting pip Downloading pip-23.1.2-py3-none-any.whl (2.1 MB) |???| 2.1 MB 8.2 MB/s Installing collected packages: pip WARNING: The scripts pip, pip3, pip3.10 and pip3.8 are installed in ‘/home/jlr/.local/bin’ which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-23.1.2 jlr@kx-csi-eval-gcp:~$ pip instal pykx ERROR: unknown command “instal” - maybe you meant “install” jlr@kx-csi-eval-gcp:~$ pip install pykx Collecting pykx Downloading pykx-1.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.7 MB) |???| 7.7 MB 521 kB/s Collecting pytz~=2022.1 Downloading pytz-2022.7.1-py2.py3-none-any.whl (499 kB) |???| 499 kB 74.0 MB/s Collecting numpy~=1.22; python_version != “3.7” Downloading numpy-1.24.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB) |???| 17.3 MB 74.1 MB/s Requirement already satisfied: pandas~=1.2 in /usr/local/lib/python3.8/dist-packages (from pykx) (1.3.0) Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.8/dist-packages (from pandas~=1.2->pykx) (2.8.2) Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.8/dist-packages (from python-dateutil>=2.7.3->pandas~=1.2->pykx) (1.15.0) ERROR: tensorflow 2.5.0 has requirement numpy~=1.19.2, but you’ll have numpy 1.24.3 which is incompatible. ERROR: scipy 1.7.0 has requirement numpy<1.23.0,>=1.16.5, but you’ll have numpy 1.24.3 which is incompatible. Installing collected packages: pytz, numpy, pykx WARNING: The scripts f2py, f2py3 and f2py3.8 are installed in ‘/home/jlr/.local/bin’ which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed numpy-1.24.3 pykx-1.6.0 pytz-2022.7.1 jlr@kx-csi-eval-gcp:~$ python3 Python 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0] on linux Type “help”, “copyright”, “credits” or “license” for more information. >>> import pykx as kx >>>
you need to have the KX license with PyKX enabled feature flag if operations in commercial licensed mode is required, if not then you will operate in unlicensed mode which is a feature limited operational mode of PyKX
https://code.kx.com/pykx/1.6/user-guide/advanced/modes.html#unlicensed-mode
how to check your KX license ? see here
https://code.kx.com/pykx/1.1/licenses.html
(base) kxapp@kx-csi-eval-gcp:~$ q KDB+ 4.0 2021.06.11 Copyright (C) 1993-2021 Kx Systems l64/ 4()core 15998MB kxapp kx-csi-eval-gcp 127.0.0.1 EXPIRE 2024.07.13 tdegen@kx.com KXMS #79940 q)" " vs .z.l 4 “insights.lib.embedq” “insights.lib.pykx” “insights.lib.sql” “insights.lib.qlog” “insights.lib.kurl” “insights.lib.objstore” “insights.lib.bigquery” “insights.lib.restserver” q)
Update here
PyKX is generally available for all users now on the GCP Advanced KDB VM.
PyKX
PyKX is KX’s flagship Python interoperability interface and recommended when working on question 3.
To access PyKX, candidates will need to use the preinstalled conda environment 'pykx, which has been licensed to allow usage of the embedded q (licensed mode) and IPC (unlicensed mode).
For more information on PyKX, please refer to https://code.kx.com/pykx
Setting up PyKX
The ~/.bashrc file should contain the following at the end of the file:
# >>> conda initialize >>> # !! Contents within this block are managed by ‘conda init’ !! __conda_setup=“$(‘/opt/miniconda3/bin/conda’ ‘shell.bash’ ‘hook’ 2> /dev/null)” if [$? -eq 0]; then eval “$__conda_setup” else if [-f “/opt/miniconda3/etc/profile.d/conda.sh”]; then . “/opt/miniconda3/etc/profile.d/conda.sh” else export PATH=“/opt/miniconda3/bin:$PATH” fi fi unset __conda_setup # <<< conda initialize <<<
To start simply run conda activate pykx
Example