KX Community

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

Home Forums KX Solutions Debugging embedPy library extension called extendPy

  • Debugging embedPy library extension called extendPy

    Posted by kovacsi on February 22, 2022 at 12:00 am

    Hi all

    I try to hack and learn how to debug python library loaded to q kdb+ context.

    I use michaelsimonelli/qoinbase-q: Q client for the Coinbase Pro API (github.com) as a sample to

    learn from.

     

    While hacking I discovered Interesting insights:

    1. embedPy doesn’t work with conda python 3.9 on win 10 x64 bit.

    2. embedPy is working with base python environment – never with conda virtual env

    so you must erase all python 3.9 base environments on windows machine to make it work.

    3. embedPy is working with conda python 3.8.10 as base env.

    4. A python package that work well with embedPy on linux will probably fail on windows

    example:

    qcoinbase fails to view and use the PublicClient module

    (py38q) E:workpy38qoinbase-q>%QCMD% C:Userssrv.condaenvspy38qqpackagesqoinbase-qcbpro.q
    KDB+ 4.0 2021.11.04 Copyright (C) 1993-2021 Kx Systems
    w64/ 16(16)core 16160MB  EXPIRE 2022.12.02

    2022.02.22T09:15:31.316 [Py] Imported module ‘builtins’
    2022.02.22T09:15:31.316 [Py] Mapped functions (builtins; list, next, vars, str) in `.py context
    2022.02.22T09:15:31.450 [Py] Imported module ‘cbpro’
    2022.02.22T09:15:31.528 [Py] Reflected module ‘cbpro’ to `cbpro context
    .

    q)key `.cbpro
    `AuthenticatedClient`CBProAuth`OrderBook`PublicClient`WebsocketClient

    q)cb:`.cbpro.PublicClient[]
    ‘cxt
    [4] C:Userssrv.condaenvspy38qqextend.q:181: .py.reflection.priv.context@:{.py.reflection.priv[y;`cxt][x;z]}

    seams `ctx is not recognized.

     

     

    I am searching for someone to help me hack the path and understand how to make it work on windows

    My hacking goal is to understand how the context “cxt parameter flows in to the module.

     

    Does anyone like to join hacking?

     

    Ori

    kovacsi replied 8 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

Log in to reply.