Jupyter on Picotte♯
Jupyter provides an interactive notebook interface for research computing, primarily with Python, but also supporting many other languages including R, Julia, and more. The recommended way to use Jupyter on Picotte is through Open OnDemand, which runs a JupyterLab server for you as a SLURM job on a compute node. Open OnDemand currently supports Python kernels, including custom Python virtual environments. It does not yet support R or Julia. To use R or Julia kernels, or to call Stata from a Python notebook, you will need to follow the steps below to manually setup your JupyterLab instnace.
Launch JupyterLab in Open OnDemand.
JupyterLab through Open OnDemand (Python)♯
Drexel network required
You must be on the Drexel network to access Picotte. If you are not on the Drexel network, you cannot connect. There are two ways to get connected:
- On campus: Be physically on campus and connect to an active Drexel Ethernet jack or DragonFly3 Wi-Fi.
- Off campus: Connect to the Drexel VPN.
Open the Jupyter Notebook launch form and sign in with your
Picotte username (without @drexel.edu) and Picotte password. You can also
find the form under Interactive Apps in OOD. Despite the app's name, it
opens the JupyterLab interface.
| Setting | What to choose |
|---|---|
| Project | The SLURM account used for this notebook. |
| Partition | A partition available to your account; see usage tiers. |
| Hours | How long the session may run. Save before this time expires. |
| CPU cores | The number of cores needed on one compute node. Requesting more cores does not automatically parallelize Python code. |
| GPUs | The number needed for GPU-enabled work; this field applies to GPU partitions. |
| Python version | The provided Python installation, unless you specify a custom virtual environment. |
| Custom virtualenv | Optional path to your Python environment; see below. |
| Working directory | An existing directory to open in JupyterLab. Leave blank for your home directory. |
The form does not have a separate memory selector. If your work requires an
explicit memory request, contact support or use a
custom SLURM workflow. For class work,
choose your course Project and the edu or gpu-edu partition; see
Picotte for classes.
For a first session, use a provided Python version and leave Custom
virtualenv blank. The provided installations include ipykernel and common
scientific packages such as NumPy, SciPy, pandas, Matplotlib, and scikit-learn.
Select Launch. OOD submits the SLURM job; when it starts, open JupyterLab from My Interactive Sessions. Create or open a notebook, then save your work in your home or group directory. Closing the browser tab does not stop the job. When finished, save your work and select Cancel on the session card to release the resources. Saved files persist after the job ends; unsaved changes and variables in memory do not.
Use a custom Python virtual environment♯
The environment must be accessible on the compute node in your home directory
or /ifs, have a working bin/python with ipykernel, and be built for
Picotte. Do not use an environment created on Windows or macOS, or one stored
in node-local /tmp or /local.
From OOD's Shell or an SSH terminal on Picotte, load the Python version you want and create the environment. This example uses Python 3.12:
module load python/gcc/3.12.10
python -m venv ~/venvs/myproject
source ~/venvs/myproject/bin/activate
unset PYTHONPATH
python -m pip install ipykernel numpy pandas matplotlib
unset PYTHONPATH prevents module-provided packages from overriding packages
installed in your environment. For packages that require substantial
compilation, install them in a
compute allocation.
Enter ~/venvs/myproject in Custom virtualenv when launching. The
environment determines the Python version, so the Python version selector
is ignored. OOD configures its notebook kernel automatically; you do not need
to register a named kernel. In a JupyterLab terminal for that session, install
additional packages with python -m pip install package_name and restart the
notebook kernel after updating packages it has already imported.
If a session fails to launch, inspect its output log from the session card.
Common causes include a missing working directory, an environment that is not
visible on the compute node, or an environment without ipykernel. See
Open OnDemand help for queue
and connection issues.
Manual Jupyter with R or Julia kernels, or Stata in Python♯
These manual workflows run the Jupyter server on the shared login node
picotte001; they do not run as a scheduled compute job. Use them only for
lightweight work. The network instructions above also apply. The Python module
provides the Jupyter application;
R and Julia use separate notebook kernels, while Stata runs through Python's
pystata package. For R or Julia, install and register the language kernel in
the environment you plan to use, then start Jupyter from VS Code's remote
terminal.
First set up VS Code Remote SSH and connect to Picotte. In its terminal, load Python:
module load python/gcc/3.10
Follow the relevant language setup below, then run jupyter-lab in the same
terminal. VS Code forwards port 8888. Choose Open in Browser when prompted, or copy
the localhost URL, including its token, from the terminal into your PC
browser. In JupyterLab's Launcher, choose the registered language kernel.
Notebook files are stored on Picotte. When finished, shut down the Jupyter
server from the JupyterLab File menu or press Ctrl-C in the terminal.
R♯
Load an R version, for example R/4.5.0, and start R. Install IRkernel if it
is not already available, then register the kernel:
module load R/4.5.0
R
install.packages("IRkernel")
IRkernel::installspec(name = "ir45", displayname = "R 4.5")
For another R version, use a distinct kernel name and display name. See the IRkernel website and GitHub repository.
Julia♯
Load the Python and Julia modules you intend to use. Start Julia, enter its
package mode by typing ], then install IJulia:
module load python/gcc/3.10
module load julia/1.11.6
julia
At the Julia prompt, type ] and run:
add IJulia
Press Ctrl-D to exit Julia. Then start jupyter-lab in the same terminal and
choose the Julia kernel in the JupyterLab Launcher.
Stata♯
Stata's pystata lets Python call Stata from a Python notebook. Load Python
and Stata before starting JupyterLab so the notebook kernel inherits the Stata
environment:
module load python/gcc/3.10
module load stata/mp48/17
jupyter-lab
In a Python notebook, configure Stata using its installation directory and edition:
import os
import stata_setup
stata_setup.config(os.environ["STATA_SYSDIR"], "mp")
Do not install pystata from PyPI; it is not the StataCorp package. If using a
different Python environment, install stata_setup as described in the
Stata configuration instructions.
See also Stata's Jupyter guide.
Deprecated JupyterHub service♯
The separate service at jupyterhub.urcf.drexel.edu is deprecated and will be removed in the future. Use Open OnDemand for new Python notebook sessions. Existing users can still access the old service through the Drexel network (campus or VPN) with Picotte credentials while it remains available. Notebook files in home and group storage can be opened from Open OnDemand, but the old service's server settings and registered kernels are not carried over. Contact support before moving a workflow that depends on a non-Python kernel.