Problem setting pypy3 as a kernel


I am having issues when trying to set pypy3 as a kernel for a Jupyter Notebook on my Windows 10 machine.

Following the instructions from these 2 threads on StackOverflow (1, 2) I have used ipykernel with the command pypy3 -m pip install ipykernel but it seems the installation runs into an error at some point:

Collecting ipykernel
  Using cached ipykernel-5.2.1-py3-none-any.whl (118 kB)
Collecting ipython>=5.0.0
  Using cached ipython-7.14.0-py3-none-any.whl (782 kB)
Collecting traitlets>=4.1.0
  Using cached traitlets-4.3.3-py2.py3-none-any.whl (75 kB)
Collecting jupyter-client
  Using cached jupyter_client-6.1.3-py3-none-any.whl (106 kB)
Collecting tornado>=4.2
  Using cached tornado-6.0.4.tar.gz (496 kB)
Requirement already satisfied: setuptools>=18.5 in c:\pypy3\site-packages (from ipython>=5.0.0->ipykernel) (44.0.0)
Collecting jedi>=0.10
  Using cached jedi-0.17.0-py2.py3-none-any.whl (1.1 MB)
Collecting decorator
  Using cached decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
Collecting pickleshare
  Using cached pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0
  Using cached prompt_toolkit-3.0.5-py3-none-any.whl (351 kB)
Collecting pygments
  Using cached Pygments-2.6.1-py3-none-any.whl (914 kB)
Collecting backcall
  Using cached backcall-0.1.0.tar.gz (9.7 kB)
Collecting colorama; sys_platform == "win32"
  Using cached colorama-0.4.3-py2.py3-none-any.whl (15 kB)
Collecting ipython-genutils
  Using cached ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB)
Collecting six
  Using cached six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting jupyter-core>=4.6.0
  Using cached jupyter_core-4.6.3-py2.py3-none-any.whl (83 kB)
Collecting pyzmq>=13
  Using cached pyzmq-19.0.1.tar.gz (1.2 MB)
Collecting python-dateutil>=2.1
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting parso>=0.7.0
  Using cached parso-0.7.0-py2.py3-none-any.whl (100 kB)
Collecting wcwidth
  Using cached wcwidth-0.1.9-py2.py3-none-any.whl (19 kB)
ERROR: Could not find a version that satisfies the requirement pywin32>=1.0; sys_platform == "win32" (from jupyter-core>=4.6.0->jupyter-client->ipykernel) (from versions: none)
ERROR: No matching distribution found for pywin32>=1.0; sys_platform == "win32" (from jupyter-core>=4.6.0->jupyter-client->ipykernel)

I have also tried with a previous version of pypy (python 2.7 compatible pypy) but ended-up with the very same error message.

Could it be that the latest versions of pypy (both python 2.7 and 3.6 flavors) are not compatible with jupyter ? Otherwise, is it possible to get around this issue ? (other than using the cell magic for pypy)

I have posted a similar question on SO but cannot put the link because of the restriction for new users.

I feel this forum isn’t very active. Would someone be kind enough to indicate where to contact the developers of Jupyter so I can ask them directly ?

Hey @solub - I can’t answer your question, but I can say that this is probably one of the friendlier places on the public internet to ask questions that members of the Jupyter developer and user community might answer.

That said, as far as I know the use of Pypy is rather niche AND there’s no dedicated project for it (it “just works” with the standard ipykernel).

Looking at your error message, I see that you’re hitting an error with pywin32. This package has been a source of headaches for me also - there was an awkward transition phase with a friendly fork and things got very hard to manage.

Anyway, back in 2018, a pywin32 dev said they would look into fixing compatability with pypy, and it’s still open:

It might be worth digging around there - posting a follow-up on that issue or elsewhere in the issue tracker.

Another approach would be to use linux. On Windows, you can use WSL. In particular, WSL2 is going to be released with the next stable release of windows, and it’s not crazy to join the “slow ring” in the windows insider program to get it now. If you go that route, I’d also flip the switch to stop getting preview builds once the next release is out:

You can also use Docker. I work for Gigantum - which is a managed / automated system for using Jupyter and/or RStudio in Docker, and it would be modestly tricky to set up Pypy, but you could do it (Jupyter should run via the installed conda/CPython but you could install pypy and an additional kernel for it). If you’re interested in going the Gigantum route, let me know and I can try to set that up.