Spaces:
Running
Running
Add jsonschema reinstallation check in start.sh
Browse filesAdded a check to reinstall jsonschema if the import fails during development mode.
start.sh
CHANGED
|
@@ -760,6 +760,14 @@ RUNTIME_JUPYTER_ENABLED="$DEV_MODE_ENABLED"
|
|
| 760 |
# Add user bin to PATH for jupyter-lab (installed in Dockerfile when DEV_MODE=true)
|
| 761 |
export PATH="$HOME/.local/bin:$PATH"
|
| 762 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 763 |
# Runtime install fallback: only attempt if DEV_MODE is enabled but install failed during build
|
| 764 |
if [ "$DEV_MODE_ENABLED" = "true" ] && ! python3 -c "import jupyterlab" >/dev/null 2>&1; then
|
| 765 |
echo "DEV_MODE enabled but jupyter-lab is missing; attempting runtime install..."
|
|
|
|
| 760 |
# Add user bin to PATH for jupyter-lab (installed in Dockerfile when DEV_MODE=true)
|
| 761 |
export PATH="$HOME/.local/bin:$PATH"
|
| 762 |
|
| 763 |
+
# Fix: reinstall jsonschema if it is broken (circular import caused by partial install)
|
| 764 |
+
if [ "$DEV_MODE_ENABLED" = "true" ]; then
|
| 765 |
+
if ! python3 -c "import jsonschema" >/dev/null 2>&1; then
|
| 766 |
+
echo "jsonschema import failed — reinstalling..."
|
| 767 |
+
python3 -m pip install --force-reinstall --no-cache-dir --break-system-packages "jsonschema>=4.0" >/dev/null 2>&1 || true
|
| 768 |
+
fi
|
| 769 |
+
fi
|
| 770 |
+
|
| 771 |
# Runtime install fallback: only attempt if DEV_MODE is enabled but install failed during build
|
| 772 |
if [ "$DEV_MODE_ENABLED" = "true" ] && ! python3 -c "import jupyterlab" >/dev/null 2>&1; then
|
| 773 |
echo "DEV_MODE enabled but jupyter-lab is missing; attempting runtime install..."
|