Necessary kernel.json to have two different python 3 versions selectable

I have the following kernel.json which works but notice the comments, to remind me to replace the “4” by a “3” in two places if I need to use python 3.13

Can someone please tell me how to modify this json file (or create two) so that I
can have both Python 3.14 and 3.13 selectable in a jupyter notebook. Note, using Windows 11 without Anaconda.

I have the following kernel.json which works but notice the comments, to remind to replace the “4” by a “3” in to two places if I need to use python 3.13

Can someone please tell me how to modify this json file (or create two) so that I
can have both Python 3.14 and 3.13 selectable in
a jupyter notebook. Note, using Windows 11 without Anaconda.
{
“argv”:[
“C:\Python314\python.exe”,
“-Xfrozen_modules=off”,
“-m”,
“ipykernel_launcher”,
“-f”,
“{connection_file}”
],
“display_name”: “Python 3.14 (ipykernel)”,
“_comment”:“C:\Python313\python.exe”,
“_comment”: “Python 3.13 (ipykernel)”,
“language”: “python”,
“metadata”: {
“debugger”: true
}
}

I just created this on a windows 11 pip based jupyter installation.

I can run python 3.14 via python and python 3.13 via python313 on the command line.

Then you would need two kernel directories side by side:

share/jupyter/kernels/python (which is the default and what you have, no changes needed here)
and i.e.
share/jupyter/kernels/python313

Then copy over the files from the default directory.

Change executable and name of the kernel in your kernel.json to something like this:

{
 "argv": [
  "python313",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3.13 (ipykernel)",
 "language": "python",
 "metadata": {
  "debugger": true
 }
}

Depending on what you have left lying around from python 3.13 in the system packages this might work directly, but if not it may be necessary to reinstall ipykernel via something like python313 -m pip install ipykernel.

2 Likes