I have python2.6 in my Linux rhel-5. I have installed pip and 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 the posiible error. Did i miss something during install. i have installed pip, wheel, pycparser, pytest, cffi....
Did you compile Python from source, and if so, did it give you any errors during the
configure/make/make install
phase? Compiling Python from source can be a real beast on older Red Hat systems, so if you installed that way, I'd suggest combing through theconfigure
andmake
output to be sure that no modules were left out.In order to get
pip install cffi
to succeed with no errors, I had to installgcc
andlibffi-devel
from the EL5 repos. From there, I was able to instantiate an FFI instance with no problems:Here's the output of
pip freeze
, for reference:If you've got the same or better versions of the relevant packages installed, I'd try a
pip -vvv install --upgrade --force-reinstall cffi
, just to see if there are perhaps errors that pip was masking, and go from there.I encountered this issue when trying to install packages in a local directory using
pip install -t .
and then running python (2.7). My solution was to remove the-t
and not install into a local directory.I needed to uninstall and install it again:
then install pagamiko again
and it start to work for me
For me there was no way to install cffi on python3.8 because of this:
Somehow, the package
python3-distutils
does not exist in Ubuntu 16.04.So I ended up installing python3.7 and now I finally could install cffi, fixing the problem mentioned by the TS.