Skip to content

Instantly share code, notes, and snippets.

@tchalvak
Last active March 15, 2017 07:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tchalvak/a230f8b759875748240d to your computer and use it in GitHub Desktop.
Save tchalvak/a230f8b759875748240d to your computer and use it in GitHub Desktop.
Running setup.py install for cryptography
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
c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/username/src/lektor/venv/build/cryptography/setup.py", line 318, in <module>
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 239, in __init__
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 264, in fetch_build_eggs
replace_conflicting=True
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 580, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 818, in best_match
return self.obtain(req, installer) # try and download/install
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 830, in obtain
return installer(requirement)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 314, in fetch_build_egg
return cmd.easy_install(req)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 593, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1003, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /home/username/src/lektor/venv/bin/python -c "import setuptools, tokenize;__file__='/home/username/src/lektor/venv/build/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/user/1000/pip-V8YFKM-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/username/src/lektor/venv/include/site/python2.7:
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
c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/username/src/lektor/venv/build/cryptography/setup.py", line 318, in <module>
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 239, in __init__
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 264, in fetch_build_eggs
replace_conflicting=True
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 580, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 818, in best_match
return self.obtain(req, installer) # try and download/install
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 830, in obtain
return installer(requirement)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 314, in fetch_build_egg
return cmd.easy_install(req)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 593, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1003, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /home/username/src/lektor/venv/bin/python -c "import setuptools, tokenize;__file__='/home/username/src/lektor/venv/build/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/user/1000/pip-V8YFKM-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/username/src/lektor/venv/include/site/python2.7 failed with error code 1 in /home/username/src/lektor/venv/build/cryptography
Storing debug log for failure in /tmp/user/1000/tmpandIQw
(venv)username@hal3k:~/src/lektor$ export LEKTOR_DEV=1
(venv)username@hal3k:~/src/lektor$ lektor quickstart --path dev-example
Traceback (most recent call last):
File "/home/username/src/lektor/venv/bin/lektor", line 5, in <module>
from pkg_resources import load_entry_point
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 2716, in <module>
working_set.require(__requires__)
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 685, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/username/src/lektor/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 588, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: cryptography>=0.7
(venv)username@hal3k:~/src/lektor
@rurtle
Copy link

rurtle commented Dec 30, 2015

I also had the same problem. It was resolved after installing libffi6 & libffi-dev. For more info on this, check this link.

Also, you'll have to install python-dev & crypto packages, as the log clearly states. For hints, check this.

@taragurung
Copy link

I am currently on same issue and but installing 4 packages mentioned above has not solved the issues in mine ,my system details
Ubuntu 14.04.5 LTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment