Python recipe execution error

ManarAlmutairi
ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

I am trying to execute variables for coders hands-on code, and I have an error displayed below

Screen Shot 2022-09-08 at 9.57.48 PM.png

and this is  line 23

Screen Shot 2022-09-08 at 9.58.09 PM.png

Tagged:

Best Answer

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker
    Answer ✓

    Hi @ManarAlmutairi
    this screenshot shows that Python 3.6 is not installed on your system. You would need to install Python 3.6. Or when you click "New Python Env", you can choose another version of Python that you do have.

    Alternatively, you can start a free trial of Dataiku Online, in which Dataiku manages the Python environment for you, and you can just choose the dash environment.

Answers

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Hi @ManarAlmutairi
    , did the initial build of the Flow succeed? That is, you have a scatterplot for the US? This would mean you have no code environment issues. If that succeeded, there are a few steps you could have missed:

    - defining the variables

    - adding 1 line of code

    - changing 1 line of code

    Let us know if that helps!

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    i think i have a problem with setting the environment.. how to set it? cuz I've been trying to set a new python environment from the settings but it won't work @SeanA

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    Screen Shot 2022-09-09 at 12.06.23 PM.png

     this is what is says

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    and i did nothing with the code.. i just copied it from the hands-on

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Hi @ManarAlmutairi
    , your problem is the code environment. You'll see in the instructions that this tutorial requires certain Python packages in order to run successfully. We have a lot of documentation on how to set code environments depending on your instance. This tutorial is one example. If you're using Dataiku Online, you just need to switch to the "dash" code environment.

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    @SeanA
    thank you for your reply! I tried to follow the document you've attached and still not working.

    Can you please walk me through the steps to switch to dash environment?

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Hi @ManarAlmutairi
    , if you are using Dataiku Online, then:

    - Go to the top navigation bar.

    - Go to the More Options (3 dots menu)

    - Click on Settings.

    - Click on "Code env selection".

    - For default Python code env, change the Mode to "Select an environment".

    - Choose "dash" as the environment.

    - Click Save.

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    Screen Shot 2022-09-09 at 6.37.25 PM.png

    there is nothing here

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Hi @ManarAlmutairi
    what instance are you using? Dataiku Online, the free locally-installed version, a company instance?

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    i guess the free ver

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Hi @ManarAlmutairi
    , click on the question mark in the top right. Click on "About". What does it say next to version?

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭
  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Hi @ManarAlmutairi
    , so yes this is indeed the free locally-installed version. In which case you are the admin of the instance. And you have to create any needed code environments yourself.

    You need to create a new Python code environment with the matplotlib package. You can find example of how to do so here: https://knowledge.dataiku.com/latest/courses/advanced-code/code-in-dss/code-environments-hands-on.html#create-a-code-environment

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    this is what i've done but still gives me an error @SeanA

    Screen Shot 2022-09-09 at 6.59.01 PM.png

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    @SeanA
    .. is it possible to work on vs code editor instead? cuz i am working on a python recipe

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Hi @ManarAlmutairi
    , you can write the actual code outside of Dataiku (such as in VS Code-- there are different integrations for this). But to run the code within Dataiku (to run the recipe), you will need that package present in the code env.

    When you try to create the code env, can you download and send the logs? You'll see a panel for it on the left.

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    @SeanA
    pardon me, do you mean log files in the Maintenance tab? if so which file? because there is nothing appearing on the left panel of creating env option

    Screen Shot 2022-09-09 at 8.00.15 PM.png

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    aren't i using the free trial of DSS? if not how to start it?

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Hi @ManarAlmutairi
    , you are using the free edition locally installed on your machine. That one is free forever for you to use!

    Dataiku Online is a managed version of Dataiku's software. When you go to this page, the first option you'll see is for the 14 day free trial. This is where to sign up for Dataiku Online (where Dataiku will manage the Python environment).

    Beneath that, it says "Install the Free Edition" and "Select your System". That's the one you have.

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    finally its working!! thank you!

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    @SeanA
    apologies but one more question

    now how to resolve this?

    Screen Shot 2022-09-09 at 9.45.34 PM.png

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Hi @ManarAlmutairi
    what action prompted this error?

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    i am working on "variables for coders" hands-on.. just wanted to execute the code

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    Right, and this is the first time you build the Flow or have you edited the code in the Python recipe?

  • ManarAlmutairi
    ManarAlmutairi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 20 ✭✭✭

    I just edited the code receipe

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Moderator Posts: 191 Dataiker

    The first step in the tutorial after creating the project and changing the code environment is to build the Flow (before changing anything in the python recipe). Did this succeed? That is, do you have the scatterplot in the final folder?

Setup Info
    Tags
      Help me…