Skip to content

New Documentation Site!

We are excited to announce the launch of our enhanced product documentation site for PyKX at docs.kx.com. It offers improved search capabilities, organized navigation, and developer-focused content. Please, take a moment to explore the site and share your feedback with us.

Using PyKX in python subprocesses

This page outlines using PyKX in a Python subprocess.

To use PyKX in a python subprocess you should spawn the process using the kx.PyKXReimport function as follows:

import pykx as kx
import subprocess
with kx.PyKXReimport():
    subprocess.Popen(['python', 'file.py']) #_Run a python subprocess that loads a python script containing a PyKX import

Failing to reimport the PyKX package running in the parent process can cause the subprocess to crash with a segmentation fault. The PyKXReimport function and possible causes of segmentation faults is covered in more detail here.