Here's the updated script since you already have JupyterLab running:[1][2]
I was implementing this on nvidia brew during the clip training
Step 1: Create the Virtual Environment
python -m venv finetuning_llamaStep 2: Activate the Virtual Environment
For Linux/macOS:
source finetuning_llama/bin/activateFor Windows (Command Prompt):
finetuning_llama\Scripts\activate.batFor Windows (PowerShell):
finetuning_llama\Scripts\Activate.ps1Step 3: Install ipykernel (JupyterLab not needed)
pip install ipykernelStep 4: Register the Virtual Environment as a Jupyter Kernel
python -m ipykernel install --user --name=finetuning_llama --display-name="Python (finetuning_llama)"Step 5: Verify the Kernel Was Added
jupyter kernelspec listStep 6: Deactivate the Environment
deactivateStep 7: Refresh JupyterLab
In your already-running JupyterLab:
- Refresh your browser page
- Go to Kernel → Change Kernel → Python (finetuning_llama)
- Or create a new notebook and select "Python (finetuning_llama)" from the launcher
You don't need to restart JupyterLab - just refresh the page and the new kernel will appear. The kernel registration happens at the system level, so your existing JupyterLab instance will automatically detect it.[2][3]
1 (opens in a new tab) 2 (opens in a new tab) 3 (opens in a new tab)