KX Community

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

Home Forums KX Solutions How to run .py in KX Developer Reply To: How to run .py in KX Developer

  • gregbowers

    Member
    March 14, 2024 at 7:46 am

    you’re encountering an issue with running Python scripts in KX Developer due to the embedPy module not being loaded.

    To resolve this issue, you need to ensure that embedPy is properly loaded in your KDB environment. You can do this by adding the following line to your q script before attempting to run any Python code:

    \l embedPy.q

    This line loads the embedPy module, allowing you to evaluate Python code within your q environment.

    Once embedPy is loaded, you should be able to run Python scripts in KX Developer without encountering the error you mentioned.

    Regarding your question about using Python to call a q database or vice versa, yes, it’s possible to integrate Python and q. You can use embedPy to call Python functions from q or vice versa. This allows you to leverage the strengths of both languages within the same environment.

    Thank you

    stevediazsalesforce cpq

    • This reply was modified 5 months, 3 weeks ago by  gregbowers.