No module named _cffi_backend

I have python2.6 in my Linux rhel-5. I installed pip and the required CFFI packages. When I try to run a sample CFFI program, it says:

ffi = FFI ()

File "/usr/lib/python2.6/site-packages/cffi/api.py", line 56, in init

import _cffi_backend as backend 

ImportError: no module named _cffi_backend

what could be a permissible error. I missed something during installation. I installed pip, wheel, pycparser, pytest, cffi ....

+7
source share
4 answers

I needed to uninstall and install again:

 sudo pip uninstall cryptography sudo pip uninstall paramiko 

and install pagamiko again

 sudo pip install paramiko 

and he starts working for me

+7
source share

Have the same problem. After many attempts to add import cffi solve the problem.

Make sure cffi and cryptography are installed.

+1
source share

Did you compile Python from the source, and if so, did it give you any errors during the configure/make/make install phase? Compiling Python from source code can be a real beast on older Red Hat systems, so if you installed this path, I suggest combing the configure and make results to make sure the modules have not been omitted.

To get pip install cffi to succeed without errors, I had to install gcc and libffi-devel from the EL5 repositories. From there, I was able to instantiate the FFI instance without any problems:

 >>> from cffi import FFI >>> ffi = FFI() >>> 

Here's the output of pip freeze , for reference:

 [ root@machine ~]# pip freeze argparse==1.2.1 autobahn==0.8.10 cffi==1.5.2 characteristic==14.3.0 pika==0.9.13 pyasn1==0.1.7 pyasn1-modules==0.0.8 pycparser==2.14 pycrypto==2.6.1 pyOpenSSL==0.12 pysnmp==4.2.5 requests==2.7.0 service-identity==14.0.0 six==1.7.3 Twisted==14.0.0 version-utils==0.2.2 wheel==0.24.0 zope.interface==4.1.1 

If you have the same or better versions of the corresponding packages installed, I would try pip -vvv install --upgrade --force-reinstall cffi to see if there are any errors that the pip masked from there.

0
source share

You can see the L56 code in /usr/lib/python2.6/site-packages/cffi/api.py

It needs _cffi_backend.so in your pythonpath. You can install python-cffi for it. But not sure if this is in your RPM repeat, especially you use RHEL-5. Here is the RPM for CENTOS http://cbs.centos.org/koji/rpminfo?rpmID=20613 Hope it helps. I'm still looking for source code to build _cffi_backend.so .

0
source share

All Articles