Problem setting up pypy3 as a kernel for Jupyter Notebook
Asked Answered
F

1

8

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

Following the instructions from these 2 other related threads (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)

Is it possible to get around that pywin32 error ?

Any help would be greatly appreciated.

Fishing answered 17/5, 2020 at 14:6 Comment(11)
I think you will need to open an issue with ipykernel and/or with pywin32. Since pywin32 does not support PyPy, either ipykernel needs a work-around or pywin32 should support PyPy.Virgiliovirgin
It's not supported as such. See this github.com/mhammond/pywin32/issues/1289, #52744076,Georgeannageorgeanne
@Virgiliovirgin Thank you for the pointer, I will probably open an issue with both.Fishing
pywin32 is not required for ipykernel directly. It seems to have been a dependency for jupyter_client at one time but that has been changed. Could you go through the list of packages here and find which one is still dependent on pywin32?Virgiliovirgin
ahh, I see it is indeed jupyter_client, needed to scroll to the right. I wonder why that is still needed?Virgiliovirgin
Something seems broken with your jupyter_client pip download. Could you purge your cached wheels and try again?Virgiliovirgin
@Virgiliovirgin Sorry do you mean doing pip cache purge from my reference python installation or from pypy3 ? Did it from both: pip3 cache purge returned Files removed: 25 and pypy3 -m pip cache purge returned ERROR: No matching packages. Either way pypy3 -m pip install ipykernel still throws the same error message.Fishing
@Virgiliovirgin Is opening an issue with ipykernel and/or with pywin32 still the right way to tackle this problem or is it something that can be resolved with a future version of pypy3 ?Fishing
Does pip install jupyter_client still want to install pywin32? If so, what happens if you download it from pypi.org/project/jupyter-client/#files ?Virgiliovirgin
Sorry: it is ipykernel. So does pip install ipykernel still want to install pywin32? If so, what happens if you download it from pypi.org/project/ipykernel/#filesVirgiliovirgin
Both pip3 install ipykernel and pypy3 -m pip install ipykernel want to install pywin32, even when installing from the wheel or tar.gz files you linked.Fishing
A
0

for Python, The modules are compiled using CPython for PYPY these are compiled using RPython.

You can try as mentioned in the documentation for pypy here, if there are no appropriate modules readily available or there is an import error.

https://doc.pypy.org/en/latest/faq.html#module-xyz-does-not-work-with-pypy-importerror

If it is for python, We can manually download an appropriate module
and install them in default site-packages folder from here:

https://pypi.org/project/pywin32/#files

Aromatize answered 26/5, 2020 at 7:2 Comment(4)
Thank you for the suggestion. Unfortunately none of the versions of this module could be installed. pypy3 -m pip install followed by the pywin32 wheel address always returns an error. ex: ERROR: pywin32-227-cp27-cp27m-win32.whl is not a supported wheel on this platform. I also tried to copy/paste the Python3 pywin32 folder in the pypy3 site-packages folder...to no avail.Fishing
pywin32-227-cp27-cp27m-win32.whl this file is for cp27. Have you tried downloading and extracting the 3.6 /3.7 version wheel file?? Depending on your version.Aromatize
I can't tell which wheel is for Python 3.6/3.7 so tried them all and none of them worked.Fishing
I just read that, we cannot use CP27 as these files are compatible for CPython compiler which is default for python. If we are using PYPY the code will be compiled using RPython. as mentioned here : doc.pypy.org/en/latest/…Aromatize

© 2022 - 2024 — McMap. All rights reserved.