Using pypy as kernel

1,735 views
Skip to first unread message

John

unread,
Oct 16, 2017, 11:00:53 AM10/16/17
to Project Jupyter
I noticed that there is a cell magic %%pypy to run python code using pypy in a single cell. Is it possible to run Jupyter notebook with pypy as the kernel for the notebook? If so how can I do this?

John

Kiko

unread,
Oct 16, 2017, 11:06:47 AM10/16/17
to jup...@googlegroups.com
you can install pypy and then, from the command line:

pypy -m pip install notebook

If you are on linux you can try
https://github.com/kikocorreoso/test_scipypy (it is not updated to the
latest pypy version).
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+u...@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/342af1b8-9215-4eee-a82f-621a4a882fc5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

John

unread,
Oct 16, 2017, 11:58:17 AM10/16/17
to Project Jupyter
I am running on Windows 7 machine and have installed python 2.7 compatible pypy 5.9.0. With it I am able to run the %%pypy cell magic in a notebook. When I tried the command

pypy -m pip install notebook

I get the error 

       Creating library build\temp.win32-2.7\Release\_scandir.pypy-41.lib and object build\temp.win32-2.7\Release\_scandir.pypy-41.exp
    _scandir.obj : error LNK2019: unresolved external symbol _PyErr_SetExcFromWindowsErrWithFilenameObject referenced in function _path_error
    build\lib.win32-2.7\_scandir.pypy-41.pyd : fatal error LNK1120: 1 unresolved externals
    error: command 'C:\\Users\\John\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1120

How can I fix this issue with the install. Are others able to run this command successfully on a windows machine?

Matthias Bussonnier

unread,
Oct 16, 2017, 11:59:07 AM10/16/17
to jup...@googlegroups.com
You do not need to install the full notebook using Pypy, what you can
do is just install ipykernel:

pypy -m pip install ipykernel
pypy -m ipykernel install --name pypy --display-name="Python (PyPy)"

And the PyPy kernel should appear alongside your other kernels.
--
M
> To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAB-sx62wBKNz3p8O1G-QrEwd%3D5K%2BxObs-_T-itFHC36-e5avrw%40mail.gmail.com.

John

unread,
Oct 16, 2017, 1:16:46 PM10/16/17
to Project Jupyter
pypy -m pip install ipykernel

fails for me on my 2 Windows machines with the same error I reported in previous response. Does this command work on windows machines or is it a know problem?

Kiko

unread,
Oct 16, 2017, 1:19:33 PM10/16/17
to jup...@googlegroups.com
2017-10-16 19:16 GMT+02:00 John <john...@shaw.ca>:
pypy -m pip install ipykernel

fails for me on my 2 Windows machines with the same error I reported in previous response. Does this command work on windows machines or is it a know problem?

Try before the following:

pypy -m ensurepip
 
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

John

unread,
Oct 16, 2017, 10:06:33 PM10/16/17
to Project Jupyter
I installed jupyter using Anaconda 3.6  on ubuntu machine along with pypy3. Then I performed these 3 commands

pypy3 -m ensurepip
pypy3 -m pip install ipykernel

which worked fine, but the third command gave an error.

pypy3 -m ipykernel install --name pypy3 --display-name="Python (PyPy)" 

[error 13]  permission denied : 'user/local/share/jupyter'

How can I fix this.

On Monday, October 16, 2017 at 8:59:07 AM UTC-7, Matthias Bussonnier wrote:

Matthias Bussonnier

unread,
Oct 16, 2017, 11:41:15 PM10/16/17
to jup...@googlegroups.com
You can get help by using the --help flag:

$ pypy3 -m ipykernel install --help
usage: ipython-kernel-install [-h] [--user] [--name NAME]
[--display-name DISPLAY_NAME]
[--profile PROFILE] [--prefix PREFIX]
[--sys-prefix]

Install the IPython kernel spec.

optional arguments:
-h, --help show this help message and exit
--user Install for the current user instead of system-wide
--name NAME Specify a name for the kernelspec. This is needed to
have multiple IPython kernels at the same time.
--display-name DISPLAY_NAME
Specify the display name for the kernelspec. This is
helpful when you have multiple IPython kernels.
--profile PROFILE Specify an IPython profile to load. This can be used
to create custom versions of the kernel.
--prefix PREFIX Specify an install prefix for the kernelspec. This is
needed to install into a non-default location, such as
a conda/virtual-env.
--sys-prefix Install to Python's sys.prefix. Shorthand for
--prefix='/Users/bussonniermatthias/anaconda'. For use
in conda/virtual-envs.


If the option are not completely clear (or you think of a better
phrasing) that would be useful feedback for us to improve the
description (you to send a PR?) hence I'm staying vague on how to fix
your issue as your understanding of this screen is valuable feedback
for us.

Thanks !
--
M
> https://groups.google.com/d/msgid/jupyter/985e9ecd-d607-4990-8a1e-50d8021f66b0%40googlegroups.com.

John

unread,
Oct 17, 2017, 12:39:55 AM10/17/17
to Project Jupyter
OK I got it to work with the command

pypy3 -m ipykernel install --user --name pypy3 --display-name "Python (PyPy)" 

Thanks

Matthias Bussonnier

unread,
Oct 17, 2017, 11:25:08 AM10/17/17
to jup...@googlegroups.com
Great! 

Was the help text sufficiently clear, or did you thought of improvements? How could we make the --help option easier to find ?
-- 

To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

John

unread,
Oct 17, 2017, 11:58:17 AM10/17/17
to Project Jupyter
Yes the help was sufficiently clear. I just forgot to try using the --help flag in this case and I was just relying on the command syntax you provided in your initial response.
Reply all
Reply to author
Forward
0 new messages