Skip to content

Installing

Installing Using pip

Ensure you have a recent version of pip:

pip install --upgrade pip

Then install the latest version of PyKX with the following command:

pip install --extra-index-url=https://$KX_PYPI_USER:$KX_PYPI_PASS@nexus.dl.kx.com/repository/pykx/simple/ pykx

To install a specific version of PyKX run the following command replacing <INSERT_VERSION> with a specific released semver version of the interface

pip install --extra-index-url=https://$KX_PYPI_USER:$KX_PYPI_PASS@nexus.dl.kx.com/repository/pykx/simple/ pykx==<INSERT_VERSION>

To get access to both a KX_PYPI_USER and KX_PYPI_PASS set of credentials to allow you install PyKX, please email sales@kx.com.

Warning

Python packages should typically be installed in a virtual environment. This can be done with the venv package from the standard library.

Supported Environments

KX only officially supports versions of PyKX built by KX, i.e. versions of PyKX installed from wheel files. Support for user-built installations of PyKX (e.g. built from the source distribution) is only provided on a best-effort basis. Currently, PyKX provides wheels for the following environments:

  • Linux (manylinux_2_17_x86_64) with CPython 3.7-3.10
  • macOS (macosx_10_10_x86_64) with CPython 3.7-3.10
  • Windows (win_amd64) with CPython 3.7-3.10

Dependencies

Python Dependencies

PyKX depends on the following third-party Python packages:

  • find-libpython~=0.2
  • pandas~=1.2

For python versions >= 3.8

  • numpy~=1.22

For python version 3.7

  • numpy~=1.20

They are installed automatically by pip when PyKX is installed.

PyKX also has an optional Python dependency of pyarrow>=3.0.0, which can be included by installing the pyarrow extra, e.g. pip install pykx[pyarrow]

Warning

Trying to use the pa conversion methods of pykx.K objects or the pykx.toq.from_arrow method when PyArrow is not installed (or could not be imported without error) will raise a pykx.PyArrowUnavailable exception.

Optional Non-Python Dependencies

Windows Dependencies

To run q or PyKX on Windows, msvcr100.dll must be installed. It is included in the Microsoft Visual C++ 2010 Redistributable.

Licensing code execution for PyKX

To run q code within PyKX an appropriate q license is required.

This license must be a k4.lic, kc.lic, or kx.lic file provided by KX and located within a users specified $QHOME/$QLIC directory. The insights.lib.embedq and insights.lib.pykx feature flags must also be enabled. You can check what feature flags you have by starting q, then running " " vs .z.l 4 - this will provide a list of the enabled feature flags for your license. If you do not have an appropriate license it will not be possible to execute q code within the Python session directly, all interactions with q in this case should be conducted via IPC communication with an external q/kdb+ server.

If you do not have access to an appropriate license or wish to trial PyKX in your organisation contact sales@kx.com.