# How to run .py in KX Developer

**URL:** <https://forum.kx.com/t/how-to-run-py-in-kx-developer/12695>\
**Category:** Community Support\
**Tags:** add-ons\
**Created:** [October 24, 2022, 1:45pm UTC](https://forum.kx.com/t/how-to-run-py-in-kx-developer/12695 "2022-10-24T13:45:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![evol1](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@evol1](https://forum.kx.com/u/evol1)\
**Post date:** [October 24, 2022, 1:45pm UTC](https://forum.kx.com/t/how-to-run-py-in-kx-developer/12695/1 "2022-10-24T13:45:00Z")

</div>

Hi community

My problem is:" I can’t open .py in KX Developer."

**error: embedPy must be loaded to evaluate Python code**

&nbsp;

My version in Conda base env

kdb 4.0

embedPy 1.5

jupyterq 1.1.13

python 3.9.12

&nbsp;

that’s my terminal code for q

&nbsp;

that’s my code for Kx developer

&nbsp;

So, how can I fix it?&nbsp;

thanks all

&nbsp;

Can I use python to call a q database? Or using q to compute python data in the same dialog box?

---

<div class="post-metadata">

**Author:** ![rocuinneagain1](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rocuinneagain1](https://forum.kx.com/u/rocuinneagain1)\
**Post date:** [October 24, 2022, 2:44pm UTC](https://forum.kx.com/t/how-to-run-py-in-kx-developer/12695/2 "2022-10-24T14:44:00Z")

</div>

Have you installed embedpy?

https://code.kx.com/q/ml/embedpy/#build-and-install

Can you load and test it?

\l p.q p)print(1+1)

&nbsp;

---

<div class="post-metadata">

**Author:** ![evol1](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@evol1](https://forum.kx.com/u/evol1)\
**Post date:** [October 24, 2022, 3:24pm UTC](https://forum.kx.com/t/how-to-run-py-in-kx-developer/12695/3 "2022-10-24T15:24:00Z")

</div>

It’s work, thanks&nbsp;

Also, I have 3 questions

01/ just like before python code, I download data from ibapi api

I can use q insert to q databases ? in the same dialog box or not ?

Can you give a simple example of Q and PYTHON&nbsp; code

02/ or use python to select data from q databases to trade?

03/ What’s different about embedPy and PYQ?

thanks

---

<div class="post-metadata">

**Author:** ![rocuinneagain1](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rocuinneagain1](https://forum.kx.com/u/rocuinneagain1)\
**Post date:** [November 10, 2022, 3:30pm UTC](https://forum.kx.com/t/how-to-run-py-in-kx-developer/12695/4 "2022-11-10T15:30:00Z")

</div>

There are useful comparisons on this page:&nbsp;https://code.kx.com/pykx/1.3/comparisons.html&nbsp;

&nbsp;

You can expose python function to q using embedpy

You can do it all in a q file or as I like to do split out to a .py and a .q

Such as:&nbsp;https://github.com/rianoc/qXML&nbsp;

&nbsp;

kdb+ can also use websockets natively if needed&nbsp;

https://code.kx.com/q/wp/websockets/&nbsp;
