HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/CrewAI-Studio/install_conda.sh
#!/bin/bash

# Get the directory of the current script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

# Path to your Miniconda installation
CONDA_PATH="$SCRIPT_DIR/miniconda"

# Function to prompt the user for yes/no response
prompt_yes_no() {
    while true; do
        read -p "$1 (y/n): " yn
        case $yn in
            [Yy]* ) return 0;;
            [Nn]* ) return 1;;
            * ) echo "Please answer yes (y) or no (n).";;
        esac
    done
}

# Check if Miniconda is already installed
if [ ! -d "$CONDA_PATH" ]; then
    # Download Miniconda installer
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh

    # Install Miniconda
    bash miniconda.sh -b -p "$CONDA_PATH"

    # Clean up installer
    rm miniconda.sh
else
    echo "Miniconda is already installed in $CONDA_PATH. Skipping installation."
fi

# Initialize Conda for this script session only
if [ -f "$CONDA_PATH/etc/profile.d/conda.sh" ]; then
    source "$CONDA_PATH/etc/profile.d/conda.sh"
else
    echo "ERROR: Miniconda installation not found at $CONDA_PATH"
    exit 1
fi

# Prompt to remove the existing environment if it exists
if conda info --envs | grep -q 'crewai'; then
    if prompt_yes_no "The Conda environment 'crewai' already exists. Do you want to reinstall it?"; then
        echo "Removing existing Conda environment..."
        conda remove --name crewai --all -y || { echo "Failed to remove existing Conda environment"; exit 1; }
    else
        echo "Installation canceled."
        exit 0
    fi
fi

# Create a new environment
conda create -n crewai python=3.11 -y || { echo "Failed to create Conda environment"; exit 1; }

# Prompt for cache usage
USE_CACHE="--no-cache"
if prompt_yes_no "Do you want to use the cache for pip installation?"; then
    USE_CACHE=""
fi

# Ensure the environment is activated and install the necessary packages
conda run -n crewai conda install -y packaging || { echo "Failed to install Conda packages"; exit 1; }
conda run -n crewai pip install -r requirements.txt $USE_CACHE || { echo "Failed to install requirements"; exit 1; }

# Agentops
echo "Do you want to install agentops? (y/n)"
read agentops
if [ "$agentops" == "y" ]; then
    echo "Installing agentops..."
    conda run -n crewai pip install agentops || { echo "Failed to install agentops"; }
fi

# Check if .env file exists, if not copy .env_example to .env
if [ ! -f "$SCRIPT_DIR/.env" ]; then
    echo ".env file does not exist. Copying .env_example to .env..."
    cp "$SCRIPT_DIR/.env_example" "$SCRIPT_DIR/.env"
fi

echo "Installation completed successfully. Do not forget to update the .env file with your credentials. Then run run_conda.sh to start the app."