简体   繁体   中英

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

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?

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).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM