First, update and upgrade Ubuntu:
sudo apt update && sudo apt -y upgrade
Next, check the Python version:
python3 --version
# Python 3.12.3
Next, install python3.12-venv
:
*Memos:
- For example, if the Python version is
Python 3.13.x
, you need to installpython3.13-venv
. - By default,
python3.xx-venv
isn't installed on Ubuntu.
sudo apt install -y python3.12-venv
This is the current directory:
pwd
# /home/kai
Next, create a virtual environment:
python3 -m venv venv
Next, activate the virtual environment:
. venv/bin/activate
Next, install PyTorch with CUDA 11.8
. *There are other CUDA(Compute Unified Device Architecture) versons and a ROCm(Radeon Open Compute Platform) version and CPU version available from here:
pip install torch torchvision torchaudio
\ --index-url https://download.pytorch.org/whl/cu118
Next, install JupyterLab:
pip install jupyterlab
Next, open JupyterLab on Firefox:
jupyter lab
*You can open JupyterLab with specific directory on Firefox:
jupyter lab --notebook-dir /home/kai
Top comments (0)