Skip to content

Instantly share code, notes, and snippets.

@twavv
Last active March 1, 2021 23:47
Show Gist options
  • Save twavv/a40a4cfeefa55f89b1e7edd90e4173a8 to your computer and use it in GitHub Desktop.
Save twavv/a40a4cfeefa55f89b1e7edd90e4173a8 to your computer and use it in GitHub Desktop.
Download these two files.

Assuming you've downloaded kernel.json,

DEST="$(jupyter --data-dir)/kernels/poetry"
mkdir -p "$DEST"
cp kernel.json "$DEST"

# Feel free to copy this to wherever, just change the line in kernel.json
chmod +x poetry-kernel.sh
sudo cp poetry-kernel.sh /usr/local/bin/
{
"display_name": "Poetry",
"argv": [
"/usr/local/bin/poetry-kernel.sh",
"-f",
"{connection_file}"
],
"language": "python",
"env": {},
"interrupt_mode": "signal"
}
#!/bin/bash -xe
# Overly simple right now, should try to catch warnings about
# not having ipython installed, etc.
poetry run python -m ipykernel_launcher $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment