"No package 'libffi' found" error during pip install
See original GitHub issueWhen I tried to pip install cairocffi into a fresh virtualenv, I got an error saying “Package libffi was not found…”
$ mkvirtualenv tmp
New python executable in tmp/bin/python
Installing setuptools............done.
Installing pip...............done.
(tmp)$ pip install cairocffi
Downloading/unpacking cairocffi
Downloading cairocffi-0.5.tar.gz (70kB): 70kB downloaded
Running setup.py egg_info for package cairocffi
no previously-included directories found matching 'docs/_build'
Downloading/unpacking cffi>=0.6 (from cairocffi)
Downloading cffi-0.6.tar.gz (169kB): 169kB downloaded
Running setup.py egg_info for package cffi
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Downloading/unpacking pycparser (from cffi>=0.6->cairocffi)
Downloading pycparser-2.09.1.tar.gz (201kB): 201kB downloaded
Running setup.py egg_info for package pycparser
Installing collected packages: cairocffi, cffi, pycparser
Running setup.py install for cairocffi
no previously-included directories found matching 'docs/_build'
Running setup.py install for cffi
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
building '_cffi_backend' extension
/usr/bin/gcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -pipe -no-cpp-precomp -pipe -arch x86_64 -I/usr/include/ffi -I/usr/include/libffi -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c c/_cffi_backend.c -o build/temp.macosx-10.7-x86_64-2.7/c/_cffi_backend.o
llvm-gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -Wl,-F. -bind_at_load -pipe -no-cpp-precomp -arch x86_64 build/temp.macosx-10.7-x86_64-2.7/c/_cffi_backend.o -lffi -o build/lib.macosx-10.7-x86_64-2.7/_cffi_backend.so
Running setup.py install for pycparser
Successfully installed cairocffi cffi pycparser
Cleaning up...
(tmp) $ python --version
Python 2.7.1
Issue Analytics
- State:
- Created 10 years ago
- Comments:21 (4 by maintainers)
Top Results From Across the Web
Getting error "No package 'libffi' found" when installing python ...
It seems the main problem is this: Package libffi was not found in the pkg-config search path. Perhaps you should add the directory ......
Read more >Getting error “No package 'libffi' found” when installing python ...
I tried to install python-telegram-bot on my raspberry pi but I got this problem: Complete output from command /usr/bin/python -u -c "import setuptools, ......
Read more >[SOLVED] Cannot install using pip - libffi error - Fedora Forum
I am trying to install scrapy and lxml via pip sudo pip install scrapy ... command python setup.py egg_info: Package libffi was not...
Read more >Python SDK install issue - AlgoSDK - Algorand Forum
I was trying to install Python SDK on Raspberry Pi OS (64bit) and I'm ... No package 'libffi' found Package libffi was not...
Read more >Installation and Status — CFFI 1.15.1 documentation
in some cases you need to be able to compile C extension modules. On non-Windows platforms, this usually means installing the package python-dev...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi. cairocffi uses CFFI, which itself requires libffi. What OS / distribution is this? You probably need to install the python-dev and libffi-dev packages.
For anyone who comes across this and it running CentOS 6 or 7, I needed to install an additional package before attempting to install Ansible using pip.
yum install libffi-devel