KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums PyKX Unable to install the pykx in DataBricks. Got PyKXException: Failed to initializ

  • Unable to install the pykx in DataBricks. Got PyKXException: Failed to initializ

    Posted by senthil on August 12, 2024 at 7:20 am

    I try to install pykx on my databricks environment. The pip install was done. When I try to import the pykx package, it throws the <b style=”font-style: italic;”>PyKXException: Failed to initialize embedded q error. It seems like, it can’t able to identify the kc.lic / k4.lic, actually the license file exists in the provided QLIC environment. Help me to solve this issue.

    Below is my error,

    #Set required environment variable. QLIC is must.

    >> import os

    >> os.environ[“QLIC”] = “/Workspace/Users/senthil/”

    >> os.environ[“QHOME”] = “/Workspace/Users/senthil/”

    >> os.environ[“QARGS”] = “–licensed -o 1”

    >> import pykx as kx

    PyKXException: Failed to initialize embedded q.Captured output from initialization attempt:

    ‘2024.08.12T08:04:56.974 couldn’t connect to license daemon — exiting

    License location used:

    /Workspace/Users/senthil/kc.lic

    —————————————————————————

    PyKXException Traceback (most recent call last)

    File <command-1353706060359333>, line 1

    —-> 1 import pykx as kx

    File /local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/pykx/__init__.py:32

    28 from . import reimporter

    29 # Importing core initializes q if in licensed mode, and loads the q C API symbols. This should

    30 # happen early on so that if the qinit check is currently happening then no time is wasted.

    31 # The current process will exit while the core module is loading if the qinit check is happening.

    —> 32 from . import core

    34 from abc import ABCMeta, abstractmethod

    35 import itertools as it

    File /local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/pykx/core.pyx:326, in init pykx.core()

    PyKXException: Failed to initialize embedded q.Captured output from initialization attempt:

    ‘2024.08.12T08:04:56.974 couldn’t connect to license daemon — exiting

    License location used: /Workspace/Users/senthil/kc.lic


    Note: The pykx package is working fine on my serverless (low level) compute. In all purpose compute I have the above error.

    senthil replied 1 month, 2 weeks ago 2 Members · 2 Replies
  • 2 Replies
  • rocuinneagain

    Member
    August 12, 2024 at 10:11 am

    The error is:

    ‘2024.08.12T08:04:56.974 couldn’t connect to license daemon — exiting

    This means the licence you have is an online-license which needs to contact a licencing server on initialisation to verify it is valid.

    The network is either not available or there are firewall rules preventing this verification to be made.

    More details here: https://code.kx.com/q/learn/licensing/#licensing-server-for-kdb-on-demand

    • senthil

      Member
      August 19, 2024 at 4:34 pm

      Hi rocuinneagain / KX,

      Thanks for your response. I understand your point. Yes, in our all-purpose compute internet communication was blocked for security purpose. But it’s typical behavior of all-purpose compute. We have another one compute called serverless compute which is used for low level query activities. In serverless compute, the internet communication is always available that’s why I can able to use pykx on that compute-based notebooks.

      Here is my follow up question, I read about pykx integration in databricks (Accelerated Data Engineering and Analytics | Databricks Blog), can you suggest which type of configuration in databrick is suitable to access the pykx or kdb+ services.

      We can’t use serverless compute for high level queries and operations. Looking forward. Thanks in advance! Happy coding!

Log in to reply.