Skip to content
Advertisement

Is it possible to run a pypy kernel in the Jupyter notebook?

I have always wondered if it were possible to run PyPy in the Jupyter notebook. I recently tried installing PyPy on my local machine, and it ran really well – 100X speedup in an agent-based simulation written in pure Python. However, I miss the interactivity in the Jupyter notebook. Is it possible to make the IPython kernel use PyPy rather than CPython?

Advertisement

Answer

Provided you have a system-wide / user installation of jupyter. You can follow:

pypy3 -m venv PyPy3
source PyPy3/bin/activate  # in POSIX, or...
PyPy3Scriptsactivate.bat  # in Windows
pypy3 -m pip install ipykernel
ipython kernel install --user --name=PyPy3

Now exit the virtual environment and verify installation:

jupyter kernelspec list

Open Jupyter notebook or lab interface.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement