cppyy icon indicating copy to clipboard operation
cppyy copied to clipboard

Failed to import CPPYY on PyPy on Windows

Open Keithcat1 opened this issue 4 years ago • 1 comments

I'm on windows 10 64-bit, using PyPy. Python 3.7.10 (77787b8f4c49, May 15 2021, 11:51:36) [PyPy 7.3.5 with MSC v.1927 64 bit (AMD64)] I did a pip install cppyy just now wwhich worked, but actually importing cppyy caused an error: C:\py>pypy3 Python 3.7.10 (77787b8f4c49, May 15 2021, 11:51:36) [PyPy 7.3.5 with MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import cppyy Traceback (most recent call last): File "", line 1, in File "C:\pypy\site-packages\cppyy_init_.py", line 72, in from ._pypy_cppyy import * File "C:\pypy\site-packages\cppyy_pypy_cppyy.py", line 33, in import _cppyy as _backend # built-in module ModuleNotFoundError: No module named '_cppyy'

Keithcat1 avatar Jul 24 '21 19:07 Keithcat1

If _cppyy isn't available, then it hasn't been enabled by upstream yet. Indeed, looking in the pypyoptions.py file, I see:

    # not ported yet
    if IS_64_BITS:
        for name in ["cpyext", "_cppyy", "micronumpy"]:
            if name in working_modules:
                working_modules.remove(name)

I do believe _cppyy itself is functional on Windows 64b, although I have no good way of testing it (I can only run Windows through VMWare on my Macbook, which isn't a realistic option to build pypy-c from source). But _cppyy depends on cpyext for some parts, which apparently in turn hasn't been ported yet either, so that's moot for now. (Upstream also has basically no Windows resources to speak of, so I don't know what the time scale for porting cpyext would be.)

(In principle, it should be possible to carve out and disable the part of _cppyy that depends on cpyext, as it's not a core feature. But then the same thing applies: no resources to test it on.)

I recommend to stay with the 32b version (esp. since w/o cpyext you won't be able to run any other extension modules either).

wlav avatar Jul 25 '21 07:07 wlav