How to use pypy as a kernel in CPython Jupyter in windows?

大憨熊 提交于 2021-02-08 03:47:27

问题


I installed python using the Anaconda installer and am happily using the version of Jupyter that comes with it. I have also downloaded the (32-bit) windows version of pypy and that works fine from the command line.

How can I get CPython Jupyter to use pypy as a kernel when running my python code?


回答1:


Pypy doesn't need a different kernel, it can just use ipykernel. It thus isn't listed separately in the list of Jupyter kernels.

You can use the same methods used for installing kernels for different Python environments to install a kernel for pypy. Eg,

pypy -m pip install ipykernel
pypy -m ipykernel install --user --name pypy --display-name "PyPy"

Or

pypy3 -m pip install ipykernel
pypy3 -m ipykernel install --user --name pypy3 --display-name "PyPy3"

The extra options are just there so that there are useful names for the kernels.

Note, however, that iPython 6 does not support Python 2.7, so if you aren't using PyPy3, you'd need to install iPython 5 in PyPy (I think it should still work with the most recent Jupyter, however).




回答2:


looking through this list (github.com/jupyter/jupyter/wiki/Jupyter-kernels) it doesn't seem like anyone implemented that already, so you might have to put together your own pypy kernel in that case. jupyter-client.readthedocs.io/en/latest/kernels.html



来源:https://stackoverflow.com/questions/44292225/how-to-use-pypy-as-a-kernel-in-cpython-jupyter-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!