Survey banner
Switching to Dataiku - a new area to help users who are transitioning from other tools and diving into Dataiku! CHECK IT OUT

Call python function on project level

Level 2
Call python function on project level


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.

0 Kudos
1 Reply


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:


0 Kudos