In the SageMaker Studio Jupyter Lab, select terminal from the launcher.
In the terminal window, type this command which creates a new Python virtual environment, then downloads, extracts, and installs the specified version of Python that you need for your project.
conda create -n python_312 python=3.12.*Source the new environment
source activate python_312Install the neeeded modules
python -m pip install ipykernel jupyterlab matplotlib torchAdd the new kernel
python -m ipykernel install --user --name python_312 --display-name my_python_312_envThe new Python environment now appears in the SageMaker Studio Jupyter Lab launcher screen, select it, by selecting my_python_312_env