Spaces:
Running
Running
File size: 1,045 Bytes
f033a7b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
#!/bin/bash
# Checking if requirements.txt exists
if [ ! -f requirements.txt ]; then
echo "Error: requirements.txt not found! Please ensure it exists in the current directory."
exit 1
fi
# Defining the environment name
env_name="Chest_Disease"
# Creating the conda environment
conda create --name "$env_name" --yes python=3.11
if [ $? -ne 0 ]; then
echo "Error: Failed to create the conda environment."
exit 1
fi
echo "Conda environment '$env_name' created successfully."
# Activating the environment
source $(conda info --base)/etc/profile.d/conda.sh
conda activate "$env_name"
if [ $? -ne 0 ]; then
echo "Error: Failed to activate the conda environment."
exit 1
fi
echo "Conda environment '$env_name' activated."
# Installing dependencies from requirements.txt
pip install -r requirements.txt
if [ $? -ne 0 ]; then
echo "Error: Failed to install dependencies from requirements.txt."
exit 1
fi
echo "Dependencies installed successfully."
echo "Your conda environment '$env_name' is ready and activated."
|