如何在Windows中的CPython Jupyter中将pypy用作内核? [英] How to use pypy as a kernel in CPython Jupyter in windows?

查看:96
本文介绍了如何在Windows中的CPython Jupyter中将pypy用作内核?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Anaconda安装程序安装了python,并且很高兴使用其随附的Jupyter版本.我还下载了(32位)Windows版本的pypy ,并且在命令行中可以正常工作.

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.

在运行python代码时,如何让CPython Jupyter将pypy用作内核?

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

推荐答案

Pypy不需要其他内核,只需使用ipykernel.因此,它没有在Jupyter内核列表中单独列出.

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

您可以使用与为不同的Python环境安装内核相同的方法为pypy安装内核.例如,

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"

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.

但是请注意,iPython 6不支持Python 2.7,因此,如果您不使用PyPy3,则需要在PyPy中安装iPython 5(但是我认为它仍应与最新的Jupyter一起使用)

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

这篇关于如何在Windows中的CPython Jupyter中将pypy用作内核?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆