Survey banner
The Dataiku Community is moving to a new home! We are temporary in read only mode: LEARN MORE

Using Models Outside DSS

Solved!
ryanraasch
Level 2
Using Models Outside DSS

I built/trained/saved a model using DSS and then saved it to my local machine as pickle file. However, when I try to "unpickle" and run the model locally, I get an error saying "ModuleNotFoundError: No module named 'dataiku'". Are there any workarounds to use dataiku models outside of dataiku? I tried 'import dataikuapi as dataiku' before loading the model, but I'm missing the actual dataiku python library. I would like to be able to use the model without having to extract the internal dataiku library that comes with DSS.

Thanks in advance for your help!


Operating system used: Windows

0 Kudos
1 Solution
gambinoga
Dataiker

Hello @ryanraasch,

Since Dataiku 11, lab models as well as saved models are now available to be exported in Python fully outside of DSS, see https://doc.dataiku.com/dss/latest/machine-learning/models-export.html#export-to-python

Indeed, you can export the model to a zip file that can then be used to score the model in any Python code.

This scoring uses the "dataiku-scoring" open source Python package, available on pypy.

However, this export is now only available in the Enterprise license.

Thanks !

Gregoire

View solution in original post

0 Kudos
6 Replies
JordanB
Dataiker

Hi @ryanraasch,

Dataiku APIs are made of two packages, "dataiku-api-client" (module name dataikuapi) and "dataiku-internal-client" (module name dataiku). The latter is not available from pypi repositories and must be downloaded from DSS itself, as indicated here: https://doc.dataiku.com/dss/latest/python-api/outside-usage.html#in-a-requirements-txt-file

Thanks!

Jordan

ryanraasch
Level 2
Author

Thank you for your response! I was trying to avoid downloading from DSS if possible.

0 Kudos
pnw_ds
Level 2

That link is giving a 404. Can you provide a valid link please? 

0 Kudos
gambinoga
Dataiker

Hello @ryanraasch,

Since Dataiku 11, lab models as well as saved models are now available to be exported in Python fully outside of DSS, see https://doc.dataiku.com/dss/latest/machine-learning/models-export.html#export-to-python

Indeed, you can export the model to a zip file that can then be used to score the model in any Python code.

This scoring uses the "dataiku-scoring" open source Python package, available on pypy.

However, this export is now only available in the Enterprise license.

Thanks !

Gregoire

0 Kudos
ryanraasch
Level 2
Author

Thank you! I thought I was using an enterprise license but apparently not. This is the sort of thing I am looking for. I appreciate your help.

0 Kudos
ssuhas76
Level 3

Hi Did you manage to get this working? i am also trying to use a saved model from a python endpoint API which also runs outside of DSS. 

0 Kudos