SyntaxError: invalid syntax

cwentz Dataiku DSS Core Concepts, Registered Posts: 33 ✭✭✭✭
edited July 16 in Using Dataiku

I ran my code in Jupyter Notebook and wrote my recipe back. Now on the code page, after clicking validate, I get a SyntaxError: invalid syntax for line 8.

%pylab inline

Screen Shot 2022-11-02 at 9.34.07 AM.png

Operating system used: MacOS Monterey 12.6



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


    '%pylab' is a magic function in Jupiter notebooks. Magic functions define shortcuts for a series of actions. In this particular case, it triggers the import of various modules within Matplotlib.

    However, magic functions will not work outside of a notebook, which is why the code recipe shows a syntax error.

    The solution here is to remove the '%pylab inline' line from the code recipe.

Setup Info
      Help me…