0

I am trying to access a function that originally form XXX.c and XXX.h, compiled to XXX.so' and then XXX_.c is made via CFFI. When the test file which simply imports XXX_ and calls a function of XXX_'s, it works fine. But when I use pypy test.py instead of python test.py, it shows the error ImportError: No module named XXX_. I read that the library in pypy is different than in python, so I try to use pypy pip to install the package, but the library has only .so, or c file but not site-package, how can I do that?

heisthere
  • 374
  • 1
  • 12
  • Does it work if you follow all the earlier steps by running `pypy` instead of `python`? For example, whatever you did to make `XXX_.c` via CFFI, you probably ran `python something.py`. So run instead `pypy something.py`. – Armin Rigo Jun 02 '20 at 16:33
  • @ArminRigo The error `fatal error: python.h: no such file or directory ` is shown up :/ – heisthere Jun 02 '20 at 16:53
  • PyPy comes with its own version of "Python.h". If you're getting this error it's probably because it is not fully installed. For example, if you're on debian, you need to install "pypy-dev" in addition to "pypy". – Armin Rigo Jun 04 '20 at 07:33
  • @ArminRigo I am using remote red hat system, I tried to install it locally, but I could not use `./configure` or `make` because the makefile did not provide any install information. Or which file should I download to get it installed on system manually? Besides, I do not really understand, if it is actually possible to use self-library in pypy by using`import...`? I could not find any documentation that mentions it. – heisthere Jun 04 '20 at 10:00
  • https://www.pypy.org/download.html ? – Armin Rigo Jun 05 '20 at 16:29
  • Also, maybe https://doc.pypy.org/en/latest/faq.html#module-xyz-does-not-work-with-pypy-importerror – Armin Rigo Jun 05 '20 at 16:31

0 Answers0