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:
JavaScript
x
6
1
pypy3 -m venv PyPy3
2
source PyPy3/bin/activate # in POSIX, or...
3
PyPy3Scriptsactivate.bat # in Windows
4
pypy3 -m pip install ipykernel
5
ipython kernel install --user --name=PyPy3
6
Now exit the virtual environment and verify installation:
JavaScript
1
2
1
jupyter kernelspec list
2
Open Jupyter notebook or lab interface.