| #!/bin/bash |
| set -e |
| echo "[Exocore] Checking Python runtime..." |
|
|
| PYTHON="" |
| for cmd in python3 python python3.12 python3.11 python3.10; do |
| if which "$cmd" > /dev/null 2>&1; then |
| |
| if "$cmd" -c "print('ok')" > /dev/null 2>&1; then |
| PYTHON=$(which "$cmd") |
| break |
| fi |
| fi |
| done |
|
|
| if [ -z "$PYTHON" ]; then |
| echo "[Exocore] Python not found. Trying nix-env install..." |
| nix-env -iA nixpkgs.python311 2>/dev/null || nix-env -iA nixpkgs.python3 2>/dev/null || true |
| for cmd in python3.11 python3 python; do |
| if which "$cmd" > /dev/null 2>&1; then |
| if "$cmd" -c "print('ok')" > /dev/null 2>&1; then |
| PYTHON=$(which "$cmd") |
| break |
| fi |
| fi |
| done |
| fi |
|
|
| if [ -z "$PYTHON" ]; then |
| echo "[Exocore] WARNING: Python not available in this environment." |
| echo "[Exocore] The project files are ready. Install Python to run: python3 app.py" |
| else |
| echo "[Exocore] Python detected: $($PYTHON --version 2>&1)" |
| fi |
|
|
| echo "[Exocore] Done! Run: python3 app.py" |
|
|