enose_2025/create_conda.sh

22 lines
748 B
Bash
Executable File

# prompt: create a bash script that check if a single argument was given and install this conda packages: python scikit-learn keras pandas numpy matplotlib tensorflow openpyxl enlighten
# if the user dont input any argument or more than 1 print a help to use the script
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <environment_name>"
echo ""
echo " Installs conda packages for a specified environment."
echo " Example: $0 enose1"
exit 1
fi
env_name=$1
conda create -n "$env_name" python scikit-learn==1.3.1 xgboost keras pandas numpy matplotlib tensorflow openpyxl xlsxwriter conda-forge::enlighten
if [ $? -eq 0 ]; then
echo "Packages installed successfully in environment '$env_name'"
else
echo "Aborted."
fi