adtech-labs
kernda
Python

Add conda activation to an IPython kernel spec

Last updated Apr 30, 2021
10
Stars
4
Forks
0
Issues
0
Stars/day
Attention Score
2
Language breakdown
Python 100.0%
Files click to expand
README

kernda

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status PyPI version codecov

Updates an IPython or IRKernel kernel spec (i.e., kernel.json file) to activate a conda environment before launching the kernel process.

Requirements

  • bash (i.e., does not yet work for kernels on Windows)

Install

pip install kernda

Usage

usage: kernda [-h] [--display-name DISPLAY_NAME] [--overwrite]
              [--env-dir ENV_DIR]
              kernel.json

positional arguments: kernel.json Path to a kernel spec

optional arguments: -h, --help show this help message and exit --display-name DISPLAY_NAME New display name for the kernel (default: keep the original) --overwrite, -o Overwrite the existing kernel spec (default: False, print to stdout --env-dir ENV_DIR Path to the conda environment that should activate (default: prefix path to the kernel in the existing kernel spec file)

Examples

# modify the kernel spec in place so that it activates the conda

environment containing the kernel binary

kernda ~/.local/share/jupyter/kernels/my_kernel/kernel.json -o

print the modified kernel spec to stdout and redirect it

to a new file

kernda /usr/local/share/jupyter/kernels/mykernel/kernel.json > otherkernel.json

modify the kernel spec in place so that it activates the

specified conda environment

kernda ~/somekernel.json -o --env-dir ~/envs/myenv
🔗 More in this category

© 2026 GitRepoTrend · adtech-labs/kernda · Updated daily from GitHub