# LicenseException: A valid q license must be in a known location (e.g. \`$QLIC\`) to run q code via 'pykx.q'.

**URL:** <https://forum.kx.com/t/licenseexception-a-valid-q-license-must-be-in-a-known-location-e-g-qlic-to-run-q-code-via-pykx-q/13196>\
**Category:** Community Support\
**Tags:** pykx, imported\
**Created:** [August 8, 2023, 12:00am UTC](https://forum.kx.com/t/licenseexception-a-valid-q-license-must-be-in-a-known-location-e-g-qlic-to-run-q-code-via-pykx-q/13196 "2023-08-08T00:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amod](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@amod](https://forum.kx.com/u/amod)\
**Post date:** [August 8, 2023, 12:00am UTC](https://forum.kx.com/t/licenseexception-a-valid-q-license-must-be-in-a-known-location-e-g-qlic-to-run-q-code-via-pykx-q/13196/1 "2023-08-08T00:00:00Z")

</div>

[https://learninghub.kx.com/forums/topic/licenseexception-a-valid-q-license-must-be-in-a-known-location-e-g-qlic-to-run-q-code-via-pykx-q](https://learninghub.kx.com/forums/topic/licenseexception-a-valid-q-license-must-be-in-a-known-location-e-g-qlic-to-run-q-code-via-pykx-q)

I am trying to run q commands through a jupyter notebook. However, I am running into the exception, whenever I am using pykx.q.&nbsp;

 
```
LicenseException: A valid q license must be in a known location (e.g. `$QLIC`) to run q code via 'pykx.q'.
```
 

&nbsp;Even while importing, I am encountering the issue

 
```
:241: PyKXWarning: Failed to initialize PyKX fully licensed functionality. To access all functionality of PyKX please download an evaluation license from[https://kx.com/kdb-insights-personal-edition-license-download/](https://kx.com/kdb-insights-personal-edition-license-download/")Full installation instructions can be found at[https://code.kx.com/pykx/getting-started/installing.html](https://code.kx.com/pykx/getting-started/installing.html")Falling back to unlicensed mode, which has limited functionality. Refer to[https://code.kx.com/pykx/user-guide/advanced/modes.html](https://code.kx.com/pykx/user-guide/advanced/modes.html")for more information on licensed vs unlicensed modalities. Captured output from initialization attempt: '2023.08.08T18:49:30.065 licence error: embedq
```
 

&nbsp;

 

I am able to use q through CLI normally. The license file is there. But somehow the exception pops up whenever I am trying to run q commands through pykx.q. I have made sure that QHOME and QLIC are pointing to the folder containing kc.lic file.&nbsp;

 

Any help or guidance to fix this issue will be great.

 

&nbsp;
