programming
Python Env Nvidia Brew

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_llama

Step 2: Activate the Virtual Environment

For Linux/macOS:

source finetuning_llama/bin/activate

For Windows (Command Prompt):

finetuning_llama\Scripts\activate.bat

For Windows (PowerShell):

finetuning_llama\Scripts\Activate.ps1

Step 3: Install ipykernel (JupyterLab not needed)

pip install ipykernel

Step 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 list

Step 6: Deactivate the Environment

deactivate

Step 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)