Last active
March 11, 2026 10:40
-
-
Save manics/ee42a681612dd880311927abec359627 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/srv/conda/envs/notebook/bin/python | |
| import os | |
| import sys | |
| try: | |
| import jupyterlab | |
| import jupyterlab.labapp | |
| major = int(jupyterlab.__version__.split(".", 1)[0]) | |
| except Exception as e: | |
| print("Failed to import jupyterlab: {e}", file=sys.stderr) | |
| have_lab = False | |
| else: | |
| have_lab = major >= 3 | |
| if have_lab: | |
| # technically, we could accept another jupyter-server-based frontend | |
| print("Launching jupyter-lab", file=sys.stderr) | |
| exe = "jupyter-lab" | |
| else: | |
| print("jupyter-lab not found, launching jupyter-notebook", file=sys.stderr) | |
| exe = "jupyter-notebook" | |
| # launch the notebook server | |
| os.execvp(exe, sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment