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. 

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

 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/ Full installation instructions can be found at 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 for more information on licensed vs unlicensed modalities.  Captured output from initialization attempt:     '2023.08.08T18:49:30.065 licence error: embedq

 

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. 

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