Conda Setup
Details on setting up conda Setup
Manual Installation
# Function to check if Conda is installed, and install it if not
install_conda() {
if command -v conda &> /dev/null; then
echo "Conda is already installed."
else
echo "Conda is not installed. Installing Miniconda..."
# Download Miniconda installer script
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"
INSTALLER="Miniconda3-latest-Linux-x86_64.sh"
# Download the Miniconda installer
curl -LO $MINICONDA_URL
# Run the installer
bash $INSTALLER -b -p $HOME/miniconda
# Initialize Conda in the current shell
source "$HOME/miniconda/etc/profile.d/conda.sh"
conda init
# Clean up the installer
rm $INSTALLER
echo "Conda installation completed. Please restart your terminal or run 'source ~/.bashrc' to activate Conda."
fi
}
Fast Setup
git clone https://github.com/fastai/fastsetup.git
to list conda envs
conda env list
To create basic conda env
After running ./setup-conda.sh, create conda environment
conda create -n <name> python
To remove conda env
conda remove --name myenv --all
To build conda env with environment file
conda env create -n <name> -f environment.yml
mamba env create -n cfast -f cfast.yml
- for creating environment files
conda env export > environment.yml
To clone an env
conda create --name <clone name> --clone <env name>
To create a spec list file
conda list --explicit > spec-file.txt
To use the spec file to install its listed packages into an existing environment:
conda install --name myenv --file spec-file.txt
To clean Mamba cache
mamba clean --yes --all