Skip to Content
Technical Articles
Author's profile photo Antonio Maradiaga

Running a Jupyter notebook in SAP Business Application Studio

In this short blog post, I will share how you can set up your SAP Business Application Studio dev space to run Jupyter notebooks 📓.

I personally enjoy working on Jupyter notebooks. It is a quick and simple tool that comes in very handy when exploring data or as a playground to test some python code.

Before we are able to run Jupyter notebooks in SAP Business Application Studio, we need to install pip. pip is the package installer for Python and we will use it to install some publicly available packages. The SAP Business Application Studio requires pip in order to be able to install ipykernel, which is need to run the notebook within the environment.

In the video above, I demo all the steps mentioned below to run Jupyter notebooks 🐍 within the SAP Business Application Studio.

Steps shown in the video:

  1. Open the terminal (F1).
  2. Download pip, install it, add its location to PATH, and then proceed to install the hana-ml and hdbcli python packages which will be imported later in the notebook.
    # Download the get-pip script, install it, add the install location to your PATH
    $ curl > && python3 &&  echo "export PATH=/home/user/.local/bin:$PATH" >> .bashrc && source ~/.bashrc
    # Install hana related python packages
    $ pip install hdbcli hana-ml shapely​
  3. Install the python and Jupyter extensions which are very useful when using Jupyter notebooks.
  4. Create a notebook and run some simple python code to install and run ipykernel. This package provides the IPython kernel for Jupyter.
    x = 1 + 2
  5. Import the previously install hana-related packages.
    from hana_ml import dataframe
    from hdbcli import dbapi​

What I like about the SAP Business Application Studio is how flexible it can be as a development environment. There is no out-of-the-box python dev space? Not a problem you can set it up yourself.

I hope you find this quick blog post useful and that it enables you to use Jupyter notebooks within your dev spaces.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Witalij Rudnicki
      Witalij Rudnicki

      Thanks for sharing this, Antonio Maradiaga!

      Author's profile photo Vishwa Gopalkrishna
      Vishwa Gopalkrishna

      Thanks for sharing Antonio Maradiaga!

      Step #2 For some reason single line command doesn't work when I try in Business Application Studio for either downloading pip or installing HANA-related packages. If I separate it out, it works. Adding a comment here to benefit others facing a similar issue.

      Author's profile photo Antonio Maradiaga
      Antonio Maradiaga
      Blog Post Author

      That's interesting... I didn't face that issue. Thanks for sharing.