#!/bin/bash # Script per installare dipendenze ML Hybrid Detector # Risolve il problema di Cython richiesto come build dependency da eif set -e echo "╔═══════════════════════════════════════════════╗" echo "║ INSTALLAZIONE DIPENDENZE ML HYBRID ║" echo "╚═══════════════════════════════════════════════╝" echo "" # Vai alla directory python_ml cd "$(dirname "$0")/../python_ml" || exit 1 echo "📍 Directory corrente: $(pwd)" echo "" # STEP 1: Installa Cython PRIMA (build dependency per eif) echo "📦 Step 1/2: Installazione Cython (richiesto per compilare eif)..." pip install --user Cython==3.0.5 if [ $? -eq 0 ]; then echo "✅ Cython installato con successo" else echo "❌ Errore durante installazione Cython" exit 1 fi echo "" # STEP 2: Installa tutte le altre dipendenze echo "📦 Step 2/2: Installazione dipendenze ML (xgboost, joblib, eif)..." pip install --user xgboost==2.0.3 joblib==1.3.2 eif==2.0.2 if [ $? -eq 0 ]; then echo "✅ Dipendenze ML installate con successo" else echo "❌ Errore durante installazione dipendenze ML" exit 1 fi echo "" echo "✅ INSTALLAZIONE COMPLETATA!" echo "" echo "🧪 Test import eif..." python3 -c "from eif import iForest; print('✅ eif importato correttamente')" if [ $? -eq 0 ]; then echo "" echo "✅ TUTTO OK! Hybrid ML Detector pronto per l'uso" else echo "❌ Errore durante test import eif" exit 1 fi