# Error with setting up libraries

**URL:** <https://forum.kx.com/t/error-with-setting-up-libraries/14117>\
**Category:** Community Support\
**Tags:** imported, kdb-insights\
**Created:** [January 9, 2025, 8:52am UTC](https://forum.kx.com/t/error-with-setting-up-libraries/14117 "2025-01-09T08:52:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Anthony](https://forum.kx.com/u/Anthony)\
**Post date:** [January 9, 2025, 8:52am UTC](https://forum.kx.com/t/error-with-setting-up-libraries/14117/1 "2025-01-09T08:52:41Z")

</div>

[https://learninghub.kx.com/forums/topic/error-with-setting-up-libraries-2](https://learninghub.kx.com/forums/topic/error-with-setting-up-libraries-2)

I am trying to set up the machine learning package and am facing an error. I will summarise my steps below and then share the error message.

1. Installed PYKX (using pip) and license is confirmed.

2. Followed the steps for embedPy and installed by downloading a release from the archives and moving p.q, p.k, and p.dll files to my QHOME directory (as instructed).

3. Cloned the ml github repository into my local repository.

4. Started a q process that loads the ml.q file. (ml/ml/ml.q)

I get the following error suggesting that I failed to load the module:

"""

(.venv) PS C:\Users\ali\OneDrive - Onyx Commodities\Documents\Projects\kdbq environment\> q main.q

KDB+ 4.1 2024.10.16 Copyright (C) 1993-2024 Kx Systems

w64/ 16(24)core 65219MB ali onyx-uk-00071 10.9.30.57 EXPIRE 2026.01.08 a.li2001@hotmail.com KDB INSIGHTS #5023662

'Failed to load PyKX or embedPy with error: p.q. OS reports: The system cannot find the file specified.

[7] C:\q\ml\ml.q:12: {'"Failed to load PyKX or embedPy with error: ",x}

^

[6] C:\q\ml\ml.q:11: {@[{system"l ",x;.pykx.loaded:0b};"p.q";

^

{'"Failed to load PyKX or embedPy with error: ",x}]}

q.ml))'2025.01.09T03:43:10.592 couldn't report -- exiting

2 3 45'2025.01.09T08:48:26.748 .Q.dbg

[2] C:\Users\ali\OneDrive - Onyx Commodities\Documents\Projects\kdbq environment\main.q:1: \l ml/ml.q

"""

---

<div class="post-metadata">

**Author:** ![rocuinneagain](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/rocuinneagain/32/287_2.png) [@rocuinneagain](https://forum.kx.com/u/rocuinneagain)\
**Post date:** [January 9, 2025, 9:23am UTC](https://forum.kx.com/t/error-with-setting-up-libraries/14117/2 "2025-01-09T09:23:59Z")

</div>

Since release 4.0.0 the ML toolkit can use either PyKX or embedPy

https://github.com/KxSystems/ml/releases

Both PyKX and embedPy cannot run in the same process so installing and using only one is best.

To make PyKX available to q processes follow:&nbsp;https://code.kx.com/pykx/3.0/pykx-under-q/intro.html#install

The command to run is:

```
python -c "import pykx;pykx.install_into_QHOME()"
```
