Call python function on project level

dhyadav79 Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 21 ✭✭✭✭


I have created a function and added with library (within folder of python) but when I try to call the function , I am getting error like "No module named 'myfun'" , When I created same function outside of folder and try to call then getting error like "NameError: name 'fun_name' is not defined

As per my understanding:

(1) create python function

(2) Added into python library

Could you please help with example where I am doing the mistake.


  • Miguel Angel
    Miguel Angel Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 118 Dataiker


    The steps to create reusable python code are detailed with some working examples here:

    The error message is letting us know it cannot find that module and the root cause could be because of several reasons, some of which are:

    • The project notebook/recipe where the module is being called is different from the project where the reusable script was created.
    • The extension of the reusable python file is not '.py', or if within a subfolder, it may be missing the file.
    • The notebook kernel needs to be restarted to pick up the changes to the project library

    I'd recommend going through with the examples in the documentation. If those examples still fail for you, we'll need some details of your instance to further investigate. That conversation will be more effective over a support ticket, which you can create here:

Setup Info
      Help me…