Issue when I import module

Registered Posts: 5 ✭✭

Hello everyone,

First of all, I've already checked the "__init__.py" file in the directory and I added the python path in external-

librairies.json.

The fact is that the problem occurs even when I'm using a notebook provided by dataiku with one of the tutorial (so that must work ??? That why I suppose that I did sth wrong with a parameter ?).

I'm not finding anymore this tutorial (that was the QuickStart, predicting if someone has a hearth disease or not) idk why but I reproduced my issue on a new notebook.

Thank you for your help !

Operating system used: Windows

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,371 Neuron

    Click on the Reload Notebook button and try the import again.

  • Registered Posts: 5 ✭✭

    Hi, thank you but that's not working, I've already tried all of the tip that you find on other discussions …

    If you have another idea don't hesitate ! Thank you

  • Registered Posts: 5 ✭✭

    I did some test and I got another error :

    I wonder if it is looking for the files in the right place ?

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,371 Neuron

    You are doing the import/library wrong. See below. You must click on FORCE RELOAD button in the Notebook every time you make changes to the library.

  • Registered Posts: 5 ✭✭

    Hello Turribeach, thank you for your help but I still have the problem, I suppose that there is an issue like this : when I run the code, it is not looking for the python file with the right path. Idk how to fix it but at this moment I'm not importing other files anymore so if anyone got the solution, please feel free to post it !

    Thank you again.

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,371 Neuron

    I don't really know what you mean by "it is not looking for the python file with the right path". But if you look at my screen shots and reproduce the module and function in the library with the same exact name you will see that it works for you too. For instance in your test the module folder name is called test_lib but you tried to do "from test import…" which won't work since test it's the name of the Python file not the module.

  • Registered Posts: 5 ✭✭

    Thank you again but that's not working for me, I did all of what you told me to do and of all what was written on several discussions but I've got another issue.

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,371 Neuron

    You were messing around with external-libraries.json, this is not required. Restore this file to its initial contents. Also make sure you:

    1. Are using a Jupyter Notebook on the same project where you editted the Library and added your custom module/function
    2. Click on the Force Reload button in the Jupyter Notebook window every time you edit/change the Library

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.