cppyy is not importable on PyPy 5.9.0

Issue #2 closed
Anonymous created an issue

I installed cppyy 0.3.0 (Compiled with GCC 5.4.0) on Ubuntu 16.04. Installed versions are: cppyy==0.3.0 cppyy-backend==0.2.2 cppyy-cling==

When I try to import cppyy I get the following error:

import cppyy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/omerk/.pyenv/versions/pypy2.7-5.9.0/site-packages/cppyy/__init__.py", line 9, in <module>
    from ._cpython_cppyy import *
  File "/home/omerk/.pyenv/versions/pypy2.7-5.9.0/site-packages/cppyy/_cpython_cppyy.py", line 20, in <module>
    import libcppyy as _backend
ImportError: No module named libcppyy

For a reason I cannot yet understand cppyy tries to load the cpython backend which does not exist since we're running on PyPy.

Comments (6)

  1. Omer Katz

    Turns out I need to export LD_LIBRARY_PATH=/home/omerk/.pyenv/versions/pypy2.7-5.9.0/site-packages/cppyy_backend/lib which is fine but should be mentioned in the error.

  2. wlav repo owner

    Yes, I was too late with some changes, before the release was cut. I have a "cppyy_compat" module for 5.7 and 5.8 that does print the message about LD_LIBRARY_PATH (see docs under "installation"). I need to put that message also in cppyy for 5.9.

  3. wlav repo owner

    With cppyy-0.3.1 (and cppyy-backend-0.2.3) there are now clearer error messages in all cases that I found things could possibly go wrong.

    Also, if '.' (current directory) happens to be in LD_LIBRARY_PATH, libcppyy_backend.so will be found through a timely chdir().

    All this is being improved in current pypy repo (there is no particular reason why LD_LIBRARY_PATH would need to be set; it's not needed for CPython).

  4. wlav repo owner

    All works with current PyPI packages (the backend selected for 5.9 is now on a branch in case further 5.9 specific changes are needed).

  5. Log in to comment