KX Community

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

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

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

    Posted by amod on August 8, 2023 at 12:00 am

    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

    <frozen importlib._bootstrap>: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.

     

    amod replied 2 months, 1 week ago 3 Members · 10 Replies
  • 10 Replies
  • amod

    Member
    August 9, 2023 at 12:00 am

    I checked for the flags but I got an empty string for the command. I also ran python -c “import pykx;pykx.util.debug_environment()”, based on one of previous answer. There also I got an empty string where flags are expected. However, I think the license is not an older version as I got it just a few days back.

  • rocuinneagain

    Member
    August 9, 2023 at 12:00 am

    You license will need the flags insights.lib.embedq and insights.lib.pykxto run pykx.q You can check your license flags in q using: q).z.l 4 “insights.lib.embedq insights.lib.pykx insights.lib.sql insights.lib.qlog ins.. If you have an older trial license you simply need to request a new one at: https://kx.com/kdb-personal-edition-download/ https://kx.com/kdb-insights-personal-edition-license-download/ Then replace the old with new on your machine. New licenses come with all the flags enabled. If it is a commercial license then your designated contact can reach out to licadmin@kx.com to have a new license issued: https://code.kx.com/q/learn/licensing/#commercial

  • rocuinneagain

    Member
    August 9, 2023 at 12:00 am

    As well as a licence expiry date each kdb+ licence also has a maintenance update date. licence expiry: You cannot use kdb+ after this date gives exp error maintenance update expiry: You cannot use versions of kdb+ newer than this date. Gives upd error https://code.kx.com/q/basics/errors/#:~:text=format%20not%20recognized-,upd,-Function%20upd%20is .e.g if you have a maintenance expiry date of 2021.12.31 but a licence expiry of 2022.06.01 this means you can use kdb+ up to 2022.06.01 as long as the version of kdb+ was released before 2021.12.31 The dates of your licence are included in the email you got from licadmin@kx.com As of 1.6.0 PyKX is based on 2023.04.17 version of q https://code.kx.com/pykx/1.6/changelog.html#pykx-160 To get a new license with a more open maintenance expiry date your designated contact can reach out to licadmin@kx.com to have a new license issued: https://code.kx.com/q/learn/licensing/#commercial

  • rocuinneagain

    Member
    August 9, 2023 at 12:00 am

    I’ve corrected my link. You specifically need the insights free trial license to get the flags: https://kx.com/kdb-insights-personal-edition-license-download/

  • powerpeanuts

    Member
    August 9, 2023 at 12:00 am

    I have similar issue as well, already set QLIC pointing to license folder, but get license error: upd, not sure if same root cause as yours.

  • rocuinneagain

    Member
    August 10, 2023 at 12:00 am

    Does the import work in unlicensed mode? set QARGS=”–unlicensed”

  • rocuinneagain

    Member
    August 11, 2023 at 12:00 am

    It’s expected that you cannot run pykx.q(‘1+1’) when in unlicensed mode. Can you try again for licensed mode after making a copy of:C:UsersAmod Shankeranaconda3envspython396python.EXE The copy should be python3.EXE:C:UsersAmod Shankeranaconda3envspython396python3.EXE + just to confirm: 1. How did you install PyKX? 2. What version have you installed? pykx.__version__ or view it in conda list

  • amod

    Member
    August 11, 2023 at 12:00 am

    I tried with python3.exe, but the behaviour remains same. I can import in unlicensed mode but it fails with licensed mode throwing .nyi error. I installed pykx using pip. I have tried it with different versions of python, i.e. 3.9.6 and 3.8 in different conda environments. They both are behaving similarly. They pykx version is 1.6.1 in my system.

  • amod

    Member
    August 11, 2023 at 12:00 am

    Yes. Following is the screenshot for the same. Everything seems fine, but again it fails with no license exception when I run a simple q command. I don’t know how relevant it is but I’m using a Windows machine with windows 11 OS.

Log in to reply.