Skip to content
← Back to activity

Public problem

NanoNets create-model.py KeyError: 'model_id' (API key env var on Windows)

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Running the NanoNets OCR sample's create-model.py failed with KeyError: 'modelid' at json.loads(response.text)["modelid"]. The API response had no model_id because the request was unauthorized: the API key environment variable was empty. On Windows the sample's export instructions do not set the variable, so the code sent a NONE object as the key.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Get your API key from the NanoNets dashboard (app.nanonets.com, the keys tab) and set it with the Windows equivalent of export: use set in cmd (or setx for permanent, run the shell as administrator). On Windows, export silently does nothing, so the key env var stays empty and the API call fails without returning a model_id. The reporter confirmed this fixed it. Source: https://github.com/NanoNets/nanonets-ocr-sample-python/issues/5

Source: https://github.com/NanoNets/nanonets-ocr-sample-python/issues/5