0

I use pip install as root. Everything works with CPython because it doesn't use the cffi backend. With PyPy I get the following error:

ImportError: PyZMQ CFFI backend couldn't find zeromq: [Errno 2] No such file or directory:  
'/********/site-packages/zmq/cffi_core/__pycache__/_cffi__g5368a726x67d4e236.c'

The '/**/site-packages/zmq/cffi_core/ directory exists and contains the following .py files(and correponding .pyc):

-rw-r--r-- 1 root 7.8K Jul 16 17:29 _cffi.py
-rw-r--r-- 1 root  406 Jul 16 17:29 constants.py
-rw-r--r-- 1 root 2.2K Jul 16 17:29 context.py
-rw-r--r-- 1 root  915 Jul 16 17:29 devices.py
-rw-r--r-- 1 root  551 Jul 16 17:29 error.py
-rw-r--r-- 1 root 1000 Jul 16 17:29 __init__.py
-rw-r--r-- 1 root 1.7K Jul 16 17:29 message.py
-rw-r--r-- 1 root 2.1K Jul 16 17:29 _poll.py
-rw-r--r-- 1 root 6.8K Jul 16 17:29 socket.py
-rw-r--r-- 1 root 1.1K Jul 16 17:29 stopwatch.py

But, there is no __pycache__ directory.

By poking around the cffi Python files (in particular verifier.py) I found that it can't find the following cffi_g5368a726x67d4e236.pypy-20.so. I couldn't find it anywhere either. I guess it is not built for some reason, but I didn't see any errors during pip install.

Does anyone have any idea?

Pyramid Newbie
  • 6,865
  • 3
  • 24
  • 28
  • Maybe setup.py is bogus and doesn't build the .so? If so, we have a problem, because the directory is installed as `root` but you're likey to run `pypy` as a normal user. Try to create the missing .so by running a `sudo pypy` in which you do `import zmq`. – Armin Rigo Jul 17 '13 at 20:26
  • There is no compilation to do at install time for PyPy (CFFI does all of the compilation at runtime). – minrk Jul 17 '13 at 23:51
  • That's correct. I had some mess with different Python versions, symlinks, virtual environments, etc. If you make it an answer I'll accept it. – Pyramid Newbie Jul 19 '13 at 16:34
  • @minrk: you are wrong: modules using CFFI that are installed with setup.py are compiled at install-time (provided it was configured this way, which is recommended). – Armin Rigo Jul 28 '13 at 14:12
  • That is not true in pyzmq. – minrk Jul 29 '13 at 15:24
  • I should clarify - no compilation happens during setup of pyzmq on PyPy, that doesn't mean it *shouldn't*. – minrk Jul 29 '13 at 17:40
  • Then it might be a bug in the setup.py of pyzmq. See: https://cffi.readthedocs.org/en/release-0.7/#distributing-modules-using-cffi – Armin Rigo Aug 02 '13 at 15:50

0 Answers0