Install and Setup UV package manager
Set UV environment
- Go to your project folder (Notebooks) and use this command to initialise uv environment:
uv venv
- To view environment is create or not use the
ls -alcommand, which will show.venvfolder is created to handle uv environment. - Now activate the environment using this command
source .venv/bin/activate.
Warning
Every time you need to activate this project environment to run the notebooks.
Set Jupyter Kernel
- To manage jupyter kernel in this create environment we first need to install the
ipykernelpackage using uv.uv pip install ipykernel
- Now to create a new kernel use this command:
python -m ipykernel install --user --name=myenv --display-name "Python (myenv)"- Here
--nameis name for your kernel and--display-nameis the displayed named for your kernel.
- To check our kernel is created or not use this kernel list command:
jupyter kernelspec list - And to delete a existing kernel use this command:
jupyter kernelspec uninstall myenv- Here instead of
myenvgive your kernel name.
- Here instead of
Installing PyTorch
- First you need to install PyTorch in the newly created environment, using UV package manager:
uv pip intall torch torchvision. - This will take some time.
Start Jupyter Lab
- Now in terminal install jupyter lab using this command for the current environment:
uv pip install jupyter lab. - After installation run the jupyter lab using this command:
jupyter lab .
Warning
Use the jupyter lab . command in the current working project directory.