forked from bluemoonfoundry/daz-script-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotebook.sh
More file actions
41 lines (33 loc) · 1.06 KB
/
Copy pathnotebook.sh
File metadata and controls
41 lines (33 loc) · 1.06 KB
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
41
#!/usr/bin/env bash
# Launch Jupyter notebook for dazpy interactive work.
# Installs required packages if missing. Works in Git Bash on Windows.
set -euo pipefail
check_package() {
python -c "import $1" 2>/dev/null
}
echo "==> Checking Python..."
if ! command -v python &>/dev/null; then
echo "ERROR: Python not found. Install Python 3.9+ and ensure it is on PATH." >&2
exit 1
fi
python --version
echo "==> Installing/verifying dazpy SDK (editable)..."
pip install -e . --quiet
echo "==> Checking for Jupyter..."
if ! check_package jupyter_server; then
echo " Installing notebook..."
pip install notebook --quiet
else
echo " Jupyter already installed."
fi
NOTEBOOKS_DIR="$(dirname "$0")/notebooks"
if [ ! -d "$NOTEBOOKS_DIR" ]; then
mkdir -p "$NOTEBOOKS_DIR"
echo "==> Created notebooks/ directory."
fi
echo ""
echo "==> Starting Jupyter Notebook..."
echo " DAZ Studio must be running with the DazScriptServer plugin active."
echo " Default server: http://127.0.0.1:18811"
echo ""
jupyter notebook --notebook-dir="$NOTEBOOKS_DIR"