Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provision fails with "fatal error: ffi.h: No such file or directory" #23

Closed
mohemian-92817281 opened this issue Sep 8, 2016 · 4 comments

Comments

@mohemian-92817281
Copy link

I tried to install LaunchKit and it failed on me on Step 6.

Running vagrant up --provision failed, resulting in the following error output:

TASK [lk-django : install python requirements] *********************************
fatal: [default]: FAILED! => {"changed": false, "cmd": "/usr/local/bin/pip install -r /vagrant/requirements.txt", "failed": true, "msg": "stdout: Requirement already satisfied (use --upgrade to upgrade): boto==2.38.0 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 1))\nRequirement already satisfied (use --upgrade to upgrade): celery[redis]==3.1.17 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 2))\nRequirement already satisfied (use --upgrade to upgrade): cssutils==1.0.1 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 3))\nRequirement already satisfied (use --upgrade to upgrade): django-bitfield==1.7.1 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 4))\nRequirement already satisfied (use --upgrade to upgrade): Django==1.7.3 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 5))\nRequirement already satisfied (use --upgrade to upgrade): djorm-pgarray==1.2.0 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 6))\nRequirement already satisfied (use --upgrade to upgrade): dnspython==1.12.0 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 7))\nCollecting fabric==1.10.1 (from -r /vagrant/requirements.txt (line 8))\nCollecting hiredis==0.1.5 (from -r /vagrant/requirements.txt (line 9))\nCollecting Pillow==3.0.0 (from -r /vagrant/requirements.txt (line 10))\nCollecting premailer==1.3.0 (from -r /vagrant/requirements.txt (line 11))\n  Using cached premailer-1.3.0-py26-none-any.whl\nCollecting psycopg2==2.5.4 (from -r /vagrant/requirements.txt (line 12))\nRequirement already satisfied (use --upgrade to upgrade): pycrypto==2.6.1 in /usr/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 13))\nCollecting pylint==0.28.0 (from -r /vagrant/requirements.txt (line 14))\nCollecting python-memcached==1.53 (from -r /vagrant/requirements.txt (line 15))\nRequirement already satisfied (use --upgrade to upgrade): redis==2.10.3 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 16))\nCollecting requests==2.5.3 (from -r /vagrant/requirements.txt (line 17))\n  Using cached requests-2.5.3-py2.py3-none-any.whl\nCollecting sqlalchemy==0.9.8 (from -r /vagrant/requirements.txt (line 18))\nCollecting tweepy==3.3.0 (from -r /vagrant/requirements.txt (line 19))\n  Using cached tweepy-3.3.0-py2.py3-none-any.whl\nCollecting ua-parser==0.3.6 (from -r /vagrant/requirements.txt (line 20))\nRequirement already satisfied (use --upgrade to upgrade): pytz>dev in /usr/local/lib/python2.7/dist-packages (from celery[redis]==3.1.17->-r /vagrant/requirements.txt (line 2))\nRequirement already satisfied (use --upgrade to upgrade): kombu<3.1,>=3.0.24 in /usr/local/lib/python2.7/dist-packages (from celery[redis]==3.1.17->-r /vagrant/requirements.txt (line 2))\nRequirement already satisfied (use --upgrade to upgrade): billiard<3.4,>=3.3.0.19 in /usr/local/lib/python2.7/dist-packages (from celery[redis]==3.1.17->-r /vagrant/requirements.txt (line 2))\nRequirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/dist-packages (from django-bitfield==1.7.1->-r /vagrant/requirements.txt (line 4))\nCollecting paramiko>=1.10 (from fabric==1.10.1->-r /vagrant/requirements.txt (line 8))\n  Using cached paramiko-2.0.2-py2.py3-none-any.whl\nCollecting cssselect (from premailer==1.3.0->-r /vagrant/requirements.txt (line 11))\n  Using cached cssselect-0.9.2-py2.py3-none-any.whl\nRequirement already satisfied (use --upgrade to upgrade): lxml in /usr/lib/python2.7/dist-packages (from premailer==1.3.0->-r /vagrant/requirements.txt (line 11))\nCollecting logilab-astng>=0.24.3 (from pylint==0.28.0->-r /vagrant/requirements.txt (line 14))\nCollecting logilab-common>=0.53.0 (from pylint==0.28.0->-r /vagrant/requirements.txt (line 14))\nCollecting requests-oauthlib>=0.4.1 (from tweepy==3.3.0->-r /vagrant/requirements.txt (line 19))\n  Using cached requests_oauthlib-0.6.2-py2.py3-none-any.whl\nRequirement already satisfied (use --upgrade to upgrade): anyjson>=0.3.3 in /usr/local/lib/python2.7/dist-packages (from kombu<3.1,>=3.0.24->celery[redis]==3.1.17->-r /vagrant/requirements.txt (line 2))\nRequirement already satisfied (use --upgrade to upgrade): amqp<2.0,>=1.4.9 in /usr/local/lib/python2.7/dist-packages (from kombu<3.1,>=3.0.24->celery[redis]==3.1.17->-r /vagrant/requirements.txt (line 2))\nCollecting cryptography>=1.1 (from paramiko>=1.10->fabric==1.10.1->-r /vagrant/requirements.txt (line 8))\n  Using cached cryptography-1.5.tar.gz\nRequirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.7 in /usr/local/lib/python2.7/dist-packages (from paramiko>=1.10->fabric==1.10.1->-r /vagrant/requirements.txt (line 8))\nRequirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages (from logilab-common>=0.53.0->pylint==0.28.0->-r /vagrant/requirements.txt (line 14))\nCollecting oauthlib>=0.6.2 (from requests-oauthlib>=0.4.1->tweepy==3.3.0->-r /vagrant/requirements.txt (line 19))\nRequirement already satisfied (use --upgrade to upgrade): idna>=2.0 in /usr/local/lib/python2.7/dist-packages (from cryptography>=1.1->paramiko>=1.10->fabric==1.10.1->-r /vagrant/requirements.txt (line 8))\nRequirement already satisfied (use --upgrade to upgrade): enum34 in /usr/local/lib/python2.7/dist-packages (from cryptography>=1.1->paramiko>=1.10->fabric==1.10.1->-r /vagrant/requirements.txt (line 8))\nRequirement already satisfied (use --upgrade to upgrade): ipaddress in /usr/local/lib/python2.7/dist-packages (from cryptography>=1.1->paramiko>=1.10->fabric==1.10.1->-r /vagrant/requirements.txt (line 8))\nCollecting cffi>=1.4.1 (from cryptography>=1.1->paramiko>=1.10->fabric==1.10.1->-r /vagrant/requirements.txt (line 8))\n  Using cached cffi-1.8.2.tar.gz\nRequirement already satisfied (use --upgrade to upgrade): pycparser in /usr/local/lib/python2.7/dist-packages (from cffi>=1.4.1->cryptography>=1.1->paramiko>=1.10->fabric==1.10.1->-r /vagrant/requirements.txt (line 8))\nBuilding wheels for collected packages: cryptography, cffi\n  Running setup.py bdist_wheel for cryptography: started\n  Running setup.py bdist_wheel for cryptography: finished with status 'error'\n  Complete output from command /usr/bin/python -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-037dd7/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" bdist_wheel -d /tmp/tmpXoHdSKpip-wheel- --python-tag cp27:\n  c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory\n   #include <ffi.h>\n                   ^\n  compilation terminated.\n  Traceback (most recent call last):\n    File \"<string>\", line 1, in <module>\n    File \"/tmp/pip-build-037dd7/cryptography/setup.py\", line 334, in <module>\n      **keywords_with_side_effects(sys.argv)\n    File \"/usr/lib/python2.7/distutils/core.py\", line 111, in setup\n      _setup_distribution = dist = klass(attrs)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/dist.py\", line 239, in __init__\n      self.fetch_build_eggs(attrs.pop('setup_requires'))\n    File \"/usr/lib/python2.7/dist-packages/setuptools/dist.py\", line 264, in fetch_build_eggs\n      replace_conflicting=True\n    File \"/usr/lib/python2.7/dist-packages/pkg_resources.py\", line 620, in resolve\n      dist = best[req.key] = env.best_match(req, ws, installer)\n    File \"/usr/lib/python2.7/dist-packages/pkg_resources.py\", line 858, in best_match\n      return self.obtain(req, installer) # try and download/install\n    File \"/usr/lib/python2.7/dist-packages/pkg_resources.py\", line 870, in obtain\n      return installer(requirement)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/dist.py\", line 314, in fetch_build_egg\n      return cmd.easy_install(req)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 616, in easy_install\n      return self.install_item(spec, dist.location, tmpdir, deps)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 646, in install_item\n      dists = self.install_eggs(spec, download, tmpdir)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 834, in install_eggs\n      return self.build_and_install(setup_script, setup_base)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 1040, in build_and_install\n      self.run_setup(setup_script, setup_base, args)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 1028, in run_setup\n      raise DistutilsError(\"Setup script exited with %s\" % (v.args[0],))\n  distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n  \n  ----------------------------------------\n  Running setup.py clean for cryptography\n  Complete output from command /usr/bin/python -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-037dd7/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" clean --all:\n  c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory\n   #include <ffi.h>\n                   ^\n  compilation terminated.\n  Traceback (most recent call last):\n    File \"<string>\", line 1, in <module>\n    File \"/tmp/pip-build-037dd7/cryptography/setup.py\", line 334, in <module>\n      **keywords_with_side_effects(sys.argv)\n    File \"/usr/lib/python2.7/distutils/core.py\", line 111, in setup\n      _setup_distribution = dist = klass(attrs)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/dist.py\", line 239, in __init__\n      self.fetch_build_eggs(attrs.pop('setup_requires'))\n    File \"/usr/lib/python2.7/dist-packages/setuptools/dist.py\", line 264, in fetch_build_eggs\n      replace_conflicting=True\n    File \"/usr/lib/python2.7/dist-packages/pkg_resources.py\", line 620, in resolve\n      dist = best[req.key] = env.best_match(req, ws, installer)\n    File \"/usr/lib/python2.7/dist-packages/pkg_resources.py\", line 858, in best_match\n      return self.obtain(req, installer) # try and download/install\n    File \"/usr/lib/python2.7/dist-packages/pkg_resources.py\", line 870, in obtain\n      return installer(requirement)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/dist.py\", line 314, in fetch_build_egg\n      return cmd.easy_install(req)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 616, in easy_install\n      return self.install_item(spec, dist.location, tmpdir, deps)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 646, in install_item\n      dists = self.install_eggs(spec, download, tmpdir)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 834, in install_eggs\n      return self.build_and_install(setup_script, setup_base)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 1040, in build_and_install\n      self.run_setup(setup_script, setup_base, args)\n    File \"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py\", line 1028, in run_setup\n      raise DistutilsError(\"Setup script exited with %s\" % (v.args[0],))\n  distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n  \n  ----------------------------------------\n  Running setup.py bdist_wheel for cffi: started\n  Running setup.py bdist_wheel for cffi: finished with status 'error'\n  Complete output from command /usr/bin/python -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-037dd7/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" bdist_wheel -d /tmp/tmpmlQBIFpip-wheel- --python-tag cp27:\n  running bdist_wheel\n  running build\n  running build_py\n  creating build\n  creating build/lib.linux-x86_64-2.7\n  creating build/lib.linux-x86_64-2.7/cffi\n  copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/commontypes.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/api.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/__init__.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/model.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/verifier.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/ffiplatform.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/cparser.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/vengine_gen.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/recompiler.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/lock.py -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/_cffi_include.h -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/parse_c_type.h -> build/lib.linux-x86_64-2.7/cffi\n  copying cffi/_embedding.h -> build/lib.linux-x86_64-2.7/cffi\n  running build_ext\n  building '_cffi_backend' extension\n  creating build/temp.linux-x86_64-2.7\n  creating build/temp.linux-x86_64-2.7/c\n  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o\n  c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory\n   #include <ffi.h>\n                   ^\n  compilation terminated.\n  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n  \n  ----------------------------------------\n  Running setup.py clean for cffi\nFailed to build cryptography cffi\nInstalling collected packages: cffi, cryptography, paramiko, fabric, hiredis, Pillow, cssselect, premailer, psycopg2, logilab-common, logilab-astng, pylint, python-memcached, requests, sqlalchemy, oauthlib, requests-oauthlib, tweepy, ua-parser\n  Running setup.py install for cffi: started\n    Running setup.py install for cffi: finished with status 'error'\n    Complete output from command /usr/bin/python -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-037dd7/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" install --record /tmp/pip-sHYgnC-record/install-record.txt --single-version-externally-managed --compile:\n    running install\n    running build\n    running build_py\n    creating build\n    creating build/lib.linux-x86_64-2.7\n    creating build/lib.linux-x86_64-2.7/cffi\n    copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/commontypes.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/api.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/__init__.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/model.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/verifier.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/ffiplatform.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/cparser.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/vengine_gen.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/recompiler.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/lock.py -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/_cffi_include.h -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/parse_c_type.h -> build/lib.linux-x86_64-2.7/cffi\n    copying cffi/_embedding.h -> build/lib.linux-x86_64-2.7/cffi\n    running build_ext\n    building '_cffi_backend' extension\n    creating build/temp.linux-x86_64-2.7\n    creating build/temp.linux-x86_64-2.7/c\n    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o\n    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory\n     #include <ffi.h>\n                     ^\n    compilation terminated.\n    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n    \n    ----------------------------------------\n\n:stderr:   Failed building wheel for cryptography\n  Failed cleaning build dir for cryptography\n  Failed building wheel for cffi\nCommand \"/usr/bin/python -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-037dd7/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" install --record /tmp/pip-sHYgnC-record/install-record.txt --single-version-externally-managed --compile\" failed with error code 1 in /tmp/pip-build-037dd7/cffi/\n"}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @ansible/vagrant.retry

PLAY RECAP *********************************************************************
default                    : ok=23   changed=0    unreachable=0    failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Anyone knows what's going on?

@ghost
Copy link

ghost commented Sep 12, 2016

@gigi-mohemian gigi please install this "sudo apt-get install build-essential libssl-dev libffi-dev python-dev" and "pip install cryptography" into to your virtual box os Thanks !

@taylorhughes taylorhughes changed the title vagrant up --provision fails with "Requirement already satisfied (use --upgrade to upgrade)" Provision fails with "fatal error: ffi.h: No such file or directory" Sep 24, 2016
@taylorhughes
Copy link
Member

If you look at the full error message it looks like your ubuntu box is possibly missing libffi-dev — what host machine system configuration were you using for vagrant/ansible/etc. in this case?

@mohemian-92817281
Copy link
Author

Commit 387203c seems to have fixed the issue! Thanks a lot for the swift response and fix! 🎉

@taylorhughes
Copy link
Member

Woohoo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants