How To Get Jupyter Python Notebook On GCP(Google Cloud Platform)

How To Get Jupyter Python Notebook On GCP(Google Cloud Platform)

How To Get Jupyter Python Notebook On GCP(Google Cloud Platform)

Introduction

Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations, and explanatory text. It provides an interactive computing environment that supports multiple programming languages, including Python, R, Julia, and more.

Jupyter Notebook is based on IPython, which is an enhanced interactive Python shell. The name “Jupyter” is derived from the combination of three core programming languages supported by the notebook: Julia, Python, and R.

The main feature of Jupyter Notebook is the ability to create and run code cells interactively. Each code cell can contain code snippets that can be executed individually, allowing you to see the output or results directly below the code cell. This interactivity makes it convenient for prototyping, data exploration, and data analysis tasks.

In this article, we will introduce three topics

  • What is Jupyter Notebook & its key features —Jupyter Notebook is an open-source web app for creating and sharing documents with live code, visualizations, and text. It provides an interactive environment for data analysis, prototyping, and collaboration, supporting various programming languages and enabling easy sharing with others.

  • Jupyter Python Notebook — All things about Jupyter Python Notebook which is provided by Techlatest.net on GCP.

  • Step by Step guide Guide on how to set up Jupyter Python Notebook On GCP(Google Cloud Platform)

Key features of Python Jupyter Notebook include:

1. Interactive Computing: Jupyter Notebook allows you to write and execute code cells interactively. You can run code snippets line by line or execute an entire cell at once. This interactive environment is ideal for exploratory data analysis, prototyping, and experimenting with code.

2. Multiple Programming Languages: Jupyter Notebook supports multiple programming languages, including Python, R, Julia, and others. This flexibility allows you to work with different languages within the same notebook and leverage the strengths of each language for various tasks.

3. Rich Output: Jupyter Notebook provides rich output capabilities, allowing you to display text, images, plots, charts, and interactive visualizations directly in the notebook. You can visualize data, create informative graphs, and generate interactive widgets to enhance your analysis and presentations.

4. Markdown Support: Jupyter Notebook supports Markdown cells, which allow you to write formatted text using Markdown syntax. Markdown cells enable you to provide documentation, explanations, or narrative context for your code, making it easier to communicate and share your work.

5. Code Execution: Jupyter Notebook enables you to execute code cells and see the output or results immediately below each cell. This feature helps you understand the impact of each code snippet, check for errors, and iterate on your code in an incremental and interactive manner.

6. Code Snippet Reusability: Jupyter Notebook allows you to define and execute code snippets in any order, making it easy to reuse and modify specific parts of your code. You can also define variables or functions in one cell and use them in subsequent cells, promoting code modularity and reusability.

7. Collaboration and Sharing: Jupyter Notebook files can be easily shared with others. You can share your notebooks as standalone files or publish them online, making it convenient for collaboration and reproducibility. Notebooks can be exported to various formats, such as HTML, PDF, or Python scripts, allowing others to view and run your code without requiring Jupyter Notebook.

8. Extensions and Customization: Jupyter Notebook supports extensions that enhance its functionality and provide additional features. These extensions enable you to customize the notebook environment, add new capabilities, and integrate with external tools and libraries.

9. Integration with Data Science Libraries: Jupyter Notebook integrates well with popular data science libraries and frameworks, such as NumPy, Pandas, matplotlib, and sci-kit-learn. You can import these libraries and use them directly in your notebook, leveraging their powerful data manipulation, analysis, and visualization capabilities.

10. Reproducible Research: Jupyter Notebook promotes reproducibility in research and data analysis. Combining code, documentation, and results in a single document, allows others to understand and replicate your work easily. Notebooks can serve as a comprehensive record of your analysis process, making it easier to track and reproduce your findings.

These key features make Python Jupyter Notebook a versatile tool for interactive computing, data exploration, collaboration, and sharing of code and results.

Jupyter Python Notebook by Techlatest

  • Jupyter Notebook preinstalled for immediate use.

  • Accessible from anywhere and anytime through JupyterHub.

  • Multiple users can collaborate simultaneously.

  • Popular Python libraries and working demos for AI and Machine Learning are included.

  • The graphical user interface for easy access to VM and management of files and Jupyter environment.

Step by Step Guide to install, and set up Jupyter Python Notebook On GCP(Google Cloud Platform)

Note: If you are setting up Jupyter Notebook to train and/or run AI & Machine Learning models, you will have to choose GPU based VM to meet the computing requirements. Choosing a CPU-based VM will result in performance bottlenecks.

Below is the step-by-step guide to install & set up Techlatest`s Jupyter Python Notebook.

  • Step 1

Open Jupyter Python Notebook listing on GCP Marketplace.

  • Step 2

Click on the Launch Button.

Select a zone where you want to launch the VM(such as us-east1-).

Optionally change the number of cores and amount of memory. ( This defaults to 2 vCPUs and 7.5 GB ram).

If you are setting up Jupyter Notebook to train and/or run AI & Machine Learning models, you will have to choose GPU based VM to meet the computing requirements

Optionally change the boot disk type and size. (This defaults to ‘Standard Persistent Disk’ and 10 GB respectively)

Optionally change the network name and subnetwork names. Be sure that whichever network you specify has ports 22 (for SSH), 3389 (for RDP) and 80 (for HTTP) exposed.

Click on the Deploy Button when you are done.

Jupyter Python Notebook will start deploying.

  • Step 3

A summary page displays when the compute engine is successfully deployed. Click on the Instance link to go to the instance page.

  • Step 4

On the instance page, click on the “SSH” button, select “Open in a browser window”.

  • Step 5

This will open the SSH window in a browser.

  • Step 6

Run the below command to set the password for the “ubuntu” user.

sudo passwd ubuntu
  • Step 7

Now the password for Ubuntu users is set, you can connect to the VM’s desktop environment from any local Windows machine using RDP or Linux machine using Remmina.

  • Step 8

To connect using RDP via Windows machine, first, note the external IP of the VM from the VM details page as highlighted below.

  • Step 9

Then From your local Windows machine, go to “start” menu, in the search box type and select “Remote desktop connection”

  • Step 10

In the “Remote Desktop Connection” wizard, paste the external IP and click on the connect Button.

  • Step 11

This will connect you to the VM’s desktop environment. Provide “ubuntu” as the user and the password set in step 6 to authenticate. Click on the OK button.

  • Step 12

Now you are connected to of box Jupyter Python Notebook environment via Windows machines.

  • Step 13

You can use the remote desktop you connected in the above step for using the VM, however, a more convenient and better method is to use the Jupyter/Ipython notebook which comes with the VM.

The Notebook is available on the same public IP you used for the remote desktop and accessible via any browser. Just open the browser and type the public IP address and you will get the below screen for login. Use “ubuntu” as the username and the password you set in Step 8 to log in.

Conclusion

In summary, Jupyter Notebook is an open-source web application that provides an interactive computing environment for creating and sharing documents that contain live code, visualizations, and explanatory text. It offers support for multiple programming languages, including Python, R, and Julia, and allows interactive code execution, Markdown support, and rich output capabilities. Jupyter Notebook promotes reproducible research, collaboration, and sharing of code and results, making it a versatile tool for interactive computing, data exploration, and analysis.

Setting up Jupyter Python Notebook on GCP involves a step-by-step process that caters to the needs of different users. It involves selecting a zone, changing the number of cores and amount of memory, optionally changing the boot disk type and size, setting up a network, and deploying the Notebook. Once deployed, users can log in to the Notebook via SSH or remote desktop and access the Notebook via any browser using the public IP address. The key features of the Jupyter Notebook outlined in this article make it an indispensable tool for data scientists, researchers, and developers who require an interactive computing environment for their projects.