#!/bin/bash # 更新系统包 sudo apt update # 使用现有的 Python 安装 JupyterLab pip install jupyterlab # 为 JupyterLab 生成配置文件(如果不存在) if [ ! -f ~/.jupyter/jupyter_lab_config.py ]; then jupyter lab --generate-config fi # 设置 JupyterLab 服务文件 SERVICE_FILE=/etc/systemd/system/jupyterlab.service sudo bash -c "cat > $SERVICE_FILE" <:8888 访问它。"