About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Last updated: Feb 21, 2025
After you create a notebook to use in the notebook editor, you need to add libraries, code, and data so you can do your analysis.
To develop analytic applications in a notebook, follow these general steps:
-
Open the notebook in edit mode: when the notebook preview window opens, click the Edit
icon. If the notebook is locked, unlock and edit it it.
-
If the notebook is marked as untrusted:
- Click on the Not Trusted notice.
- Click Trust to execute all cells.
-
Determine if the environment template that is associated with the notebook has the correct hardware size for the anticipated analysis processing throughput.
-
Check the size of the environment by clicking the View notebook info icon (
) from the notebook toolbar and selecting the Environments page.
-
If you need to change the environment, select another environment from the list or, if none of the available environments fits your needs, create your own environment template. See Creating environment template.
If you create your own environment template, you can add your libraries to this template. These libraries are preinstalled at the time the environment is started. See Customize your environment for Python and R.
-
-
Import preinstalled libraries. See Libraries and scripts for notebooks.
-
Load and access data. You can access data from project assets by running code that is generated for you when you select the asset or programmatically by using preinstalled library functions. See Load and access data.
-
Prepare and analyze the data with the appropriate methods:
-
If necessary, schedule the notebook to run at a regular time. See Schedule a notebook.
- Monitor the status of your job runs from the project's Jobs page.
- Click your job to open the job's details page to view the runs for your job and the status of each run. If a run failed, you can select the run and view the log tail or download the entire log file to troubleshoot the run.
-
If you have problems running your code, use the Debugger to go through a code cell in your notebook. To activate the debugger:
- Click on the Enable Debugger icon (
) in the notebook toolbar.
- Click next to any line of code to add a breakpoint.
To debug your code from the View menu, select Right Sidebar, and then select Show Debugger.
- Click on the Enable Debugger icon (
-
When you're not actively working on the notebook, go to Kernel and click Shut Down Kernel to stop the notebook kernel and free up resources.
-
Stop the active runtime (and unnecessary capacity unit consumption) if no other notebook kernels are active under Tool runtimes on the Environments page on the Manage tab of your project.
Watch this short video to see how to create a Jupyter notebook and custom environment.
This video provides a visual method to learn the concepts and tasks in this documentation.
Watch this short video to see how to run basic SQL queries on Db2 Warehouse data in a Python notebook.
This video provides a visual method to learn the concepts and tasks in this documentation.
Find videos showing additional examples of Python notebooks on the Videos page.
Installing packages from conda
or mamba
through a proxy server
conda
mamba
Note:
- If you want
orconda
to use a proxy server as an intermediary to the publicmamba
andconda
repositories, your platform administrator must configure it for you.mamba
The
setting that is used by the admin is currently ignored when you run proxy_servers
from within a notebook. Software customizations that use !mamba install
are not affected
by this limitation. To configure proxy servers for mamba
when you run mamba
from within a notebook, set the proxy server by using an environment variable:!mamba install <lib-package>
%env http_proxy=http://username:password@corp.com:8080 %env https_proxy=https://username:password@corp.com:8080
Alternatively, install the package in the notebook by using
, which respects the conda
setting that your admin set in the proxy_servers
file..condarc
Installing packages from pip
through a proxy server
pip
Your platform administtrator can configure
for use behind a proxy server by creating a clusterwide pip
configuration file called pip
. This file can contain a specific package index or a proxy server.pip.conf
Run the following commands in a notebook to test if the connection is working.
For a proxy server, run this command:
!python -m pip install langdetect --proxy https://www.example.com:<port number>
For an internal index, run this command:
!pip install <some_package> --index-url=http://www.example.com/root/pypi/+simple/ --trusted-host=http://www.example.com
If the connection is not working, contact your platform administrator.
Learn more
Parent topic: Jupyter Notebook editor