Environments
Table of Contents
Overview
Using Jarvislabs, you can create one of the following instances:
- PyTorch
- FastAI
- Tensorflow
To simplify your workflow, we regularly install and update the latest versions of these software packages. As your projects grow more complex, you may want to create and maintain separate environments. You can create new environments using:
- Conda
- Pyenv
Creating and Managing Environments
Creating and Managing a New Environment Using Conda
Create a New Environment
To create a new environment with Python 3.10, use the following command:
conda create --prefix </path/yourEnvName> <python-version>
Example:
conda create --prefix /home/myenv python=3.10 ipykernel -y
The --prefix
option allows you to specify the installation path. Installations in the /home
directory persist when you pause and resume an instance.
Note: If you do not use the --prefix
option, the environment is installed in the /root
location, which resets when you pause and resume an instance.
Activate the New Conda Environment
To install new libraries in the environment, activate it using:
conda activate /home/myenv/
If you encounter errors while activating, try the following commands in a terminal:
conda init bash
source .bashrc
Start a New Kernel from JupyterLab
To use the new environment in JupyterLab, set up the kernel:
conda activate /home/myenv/
python -m ipykernel install --user --name=myenv
After refreshing JupyterLab, you can create a notebook with the new conda environment.
Creating a New Environment Using Venv
To create a new environment with the existing Python version, use:
python -m venv NAME
Replace NAME
with your desired environment name.
Example:
python -m venv myenv
To use a different Python version:
python3.12 -m venv new_venv
Ensure Python 3.12 is installed on your system.
Activate the environment you just created:
source NAME/bin/activate