Automation to the rescue-- here's newkernel.cmd:
@echo off REM newkernel.bat - create a python virtualenv and register it as a REM Jupyter kernel REM SET /P _envname="Name of environment:" if "%_envname%x" NEQ "x" goto :got_name @REM else set _envname=py-%USERNAME%-%RANDOM% @REM fi :got_name C:\tools\Anaconda3\python.exe -m venv %_envname%.venv set /P _envkern="Kernel name:" if "%_envkern%x" NEQ "x" goto :got_kern @REM else set _envkern=py-%_envname% @REM fi :got_kern set /P _envdesc="Kernel Description:" if "%_envdesc%x" NEQ "x" goto :got_desc @REM else set _envdesc="Python (%_envname%)" @REM fi :got_desc %_envname%.venv\scripts\pip install ipykernel %_envname%.venv\scripts\python -m ipykernel install --name %_envkern% --display-name "%_envdesc%"
No comments:
Post a Comment