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

Installing requests[security] is failing #231

Closed
jayd3e opened this issue Jun 3, 2015 · 6 comments
Closed

Installing requests[security] is failing #231

jayd3e opened this issue Jun 3, 2015 · 6 comments

Comments

@jayd3e
Copy link

jayd3e commented Jun 3, 2015

We have been using requests for a while in our app, and now recently found some situations where error messages were getting logged due to not having the correct environment for SSL. So we started using requests[security]. Deploys started failing after that with the following message:

INFO:piapp.cli.commands.deploy:command git push heroku-dev development:master
Counting objects: 872, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (688/688), done.
Writing objects: 100% (705/705), 119.89 KiB, done.
Total 705 (delta 548), reused 18 (delta 14)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Python app detected
remote: -----> Installing dependencies with pip
remote:        Obtaining file:///app (from -r requirements.txt (line 44))
remote:        Obtaining python-firebase from git+https://github.com/ozgur/python-firebase.git#egg=python-firebase (from -r requirements.txt (line 42))
remote:          Updating ./.heroku/src/python-firebase clone
remote:        Obtaining apns from git+https://github.com/djacobs/PyAPNs.git@d66f45e997cce916d3cf9cb8e0b9754a61e9fd15#egg=apns (from -r requirements.txt (line 43))
remote:          Updating ./.heroku/src/apns clone (to d66f45e997cce916d3cf9cb8e0b9754a61e9fd15)
remote:   Could not find a tag or branch 'd66f45e997cce916d3cf9cb8e0b9754a61e9fd15', assuming commit.
remote:        Collecting pyOpenSSL (from requests[security]->-r requirements.txt (line 27))
remote:          Downloading pyOpenSSL-0.15.1-py2.py3-none-any.whl (102kB)
remote:        Collecting ndg-httpsclient (from requests[security]->-r requirements.txt (line 27))
remote:          Downloading ndg_httpsclient-0.4.0.tar.gz
remote:        Collecting pyasn1 (from requests[security]->-r requirements.txt (line 27))
remote:          Downloading pyasn1-0.1.7.tar.gz (68kB)
remote:        Collecting cryptography>=0.7 (from pyOpenSSL->requests[security]->-r requirements.txt (line 27))
remote:          Downloading cryptography-0.9.tar.gz (302kB)
remote:        Collecting idna (from cryptography>=0.7->pyOpenSSL->requests[security]->-r requirements.txt (line 27))
remote:          Downloading idna-2.0-py2.py3-none-any.whl (61kB)
remote:        Collecting enum34 (from cryptography>=0.7->pyOpenSSL->requests[security]->-r requirements.txt (line 27))
remote:          Downloading enum34-1.0.4.tar.gz
remote:        Collecting ipaddress (from cryptography>=0.7->pyOpenSSL->requests[security]->-r requirements.txt (line 27))
remote:          Downloading ipaddress-1.0.7-py27-none-any.whl
remote:        Collecting cffi>=0.8 (from cryptography>=0.7->pyOpenSSL->requests[security]->-r requirements.txt (line 27))
remote:          Downloading cffi-1.1.0.tar.gz (323kB)
remote:        Collecting pycparser (from cffi>=0.8->cryptography>=0.7->pyOpenSSL->requests[security]->-r requirements.txt (line 27))
remote:          Downloading pycparser-2.13.tar.gz (299kB)
remote:        Installing collected packages: python-firebase, apns, piapp, idna, pyasn1, enum34, ipaddress, pycparser, cffi, cryptography, pyOpenSSL, ndg-httpsclient
remote:          Running setup.py develop for python-firebase
remote:          Running setup.py develop for apns
remote:          Running setup.py develop for piapp
remote:          Running setup.py install for pyasn1
remote:          Running setup.py install for enum34
remote:          Running setup.py install for pycparser
remote:          Running setup.py install for cffi
remote:            Complete output from command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Nk2QCp/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ESDL2z-record/install-record.txt --single-version-externally-managed --compile:
remote:            Package libffi was not found in the pkg-config search path.
remote:            Perhaps you should add the directory containing `libffi.pc'
remote:            to the PKG_CONFIG_PATH environment variable
remote:            No package 'libffi' found
remote:            Package libffi was not found in the pkg-config search path.
remote:            Perhaps you should add the directory containing `libffi.pc'
remote:            to the PKG_CONFIG_PATH environment variable
remote:            No package 'libffi' found
remote:            Package libffi was not found in the pkg-config search path.
remote:            Perhaps you should add the directory containing `libffi.pc'
remote:            to the PKG_CONFIG_PATH environment variable
remote:            No package 'libffi' found
remote:            Package libffi was not found in the pkg-config search path.
remote:            Perhaps you should add the directory containing `libffi.pc'
remote:            to the PKG_CONFIG_PATH environment variable
remote:            No package 'libffi' found
remote:            Package libffi was not found in the pkg-config search path.
remote:            Perhaps you should add the directory containing `libffi.pc'
remote:            to the PKG_CONFIG_PATH environment variable
remote:            No package 'libffi' found
remote:            running install
remote:            running build
remote:            running build_py
remote:            creating build
remote:            creating build/lib.linux-x86_64-2.7
remote:            creating build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/gc_weakref.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/vengine_gen.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/api.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/model.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/lock.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/__init__.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/ffiplatform.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/commontypes.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/recompiler.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/verifier.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/cparser.py -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/_cffi_include.h -> build/lib.linux-x86_64-2.7/cffi
remote:            copying cffi/parse_c_type.h -> build/lib.linux-x86_64-2.7/cffi
remote:            running build_ext
remote:            building '_cffi_backend' extension
remote:            creating build/temp.linux-x86_64-2.7
remote:            creating build/temp.linux-x86_64-2.7/c
remote:            gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/app/.heroku/python/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
remote:            c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory
remote:             #include <ffi.h>
remote:                             ^
remote:            compilation terminated.
remote:            error: command 'gcc' failed with exit status 1
remote:
remote:            ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Nk2QCp/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ESDL2z-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Nk2QCp/cffi
remote:
remote:  !     Push rejected, failed to compile Python app
remote:
remote: Verifying deploy....
remote:
remote: !   Push rejected to piapp-web-dev.
remote:
To [email protected]:piapp-web-dev.git
 ! [remote rejected] development -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:app.git'

After finding this PR https://github.com/heroku/heroku-buildpack-python/pull/172/files, I added cffi to our requirements.txt which fixed it. Just thought I would bring this up, maybe add requests[security] to the list of whitelisted dependencies that need cffi.

@kennethreitz
Copy link
Contributor

Hello,

In order to use requests[security], you also have to have "cryptography" or "libffi" in your requirements.txt file.

@RyanBalfanz
Copy link

FWIW, this doesn't solve my problem when using the heroku-docker plugin.

$ grep cffi requirements.txt
cffi==1.5.2               # via cryptography
pycparser==2.14           # via cffi
$ docker-compose up web
…
  Running setup.py bdist_wheel for cffi: started
  Running setup.py bdist_wheel for cffi: finished with status 'error'
  Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FW74VY/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpvioEa9pip-wheel- --python-tag cp27:
  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
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/cffi
  copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/cparser.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/gc_weakref.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/__init__.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/verifier.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/recompiler.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/api.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/model.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/ffiplatform.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/vengine_gen.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/lock.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/commontypes.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/_cffi_include.h -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/parse_c_type.h -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/_embedding.h -> build/lib.linux-x86_64-2.7/cffi
  running build_ext
  building '_cffi_backend' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/c
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/app/.heroku/python/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
  c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
   #include <ffi.h>
                   ^
  compilation terminated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Running setup.py clean for cffi
  Failed building wheel for cffi
  Running setup.py bdist_wheel for cryptography: started
  Running setup.py bdist_wheel for cryptography: finished with status 'error'
  Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FW74VY/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpwY_Pmgpip-wheel- --python-tag cp27:
  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:15: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 "/tmp/pip-build-FW74VY/cryptography/setup.py", line 335, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/app/.heroku/python/lib/python2.7/distutils/core.py", line 111, in setup
      _setup_distribution = dist = klass(attrs)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
      self.fetch_build_eggs(attrs['setup_requires'])
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
      replace_conflicting=True,
    File "/app/.heroku/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 828, in resolve
      dist = best[req.key] = env.best_match(req, ws, installer)
    File "/app/.heroku/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1073, in best_match
      return self.obtain(req, installer)
    File "/app/.heroku/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1085, in obtain
      return installer(requirement)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
      return cmd.easy_install(req)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 640, in easy_install
      return self.install_item(spec, dist.location, tmpdir, deps)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 670, in install_item
      dists = self.install_eggs(spec, download, tmpdir)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 853, in install_eggs
      return self.build_and_install(setup_script, setup_base)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1081, in build_and_install
      self.run_setup(setup_script, setup_base, args)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1069, in run_setup
      raise DistutilsError("Setup script exited with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Running setup.py clean for cryptography
  Failed building wheel for cryptography
  Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FW74VY/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" clean --all:
  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:15: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 "/tmp/pip-build-FW74VY/cryptography/setup.py", line 335, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/app/.heroku/python/lib/python2.7/distutils/core.py", line 111, in setup
      _setup_distribution = dist = klass(attrs)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
      self.fetch_build_eggs(attrs['setup_requires'])
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
      replace_conflicting=True,
    File "/app/.heroku/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 828, in resolve
      dist = best[req.key] = env.best_match(req, ws, installer)
    File "/app/.heroku/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1073, in best_match
      return self.obtain(req, installer)
    File "/app/.heroku/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1085, in obtain
      return installer(requirement)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
      return cmd.easy_install(req)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 640, in easy_install
      return self.install_item(spec, dist.location, tmpdir, deps)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 670, in install_item
      dists = self.install_eggs(spec, download, tmpdir)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 853, in install_eggs
      return self.build_and_install(setup_script, setup_base)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1081, in build_and_install
      self.run_setup(setup_script, setup_base, args)
    File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1069, in run_setup
      raise DistutilsError("Setup script exited with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed cleaning build dir for cryptography
  Running setup.py bdist_wheel for dj-database-url: started
  Running setup.py bdist_wheel for dj-database-url: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/5f/a6/6b/28940943d7e38eca4f576bdca45ac02b1f15c3dba3e150bc17
  Running setup.py bdist_wheel for django-jsonfield: started
  Running setup.py bdist_wheel for django-jsonfield: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/16/29/23/d84c7e8dd321270e324bb89c07c8bb48824f1c182c58167ca8
  Running setup.py bdist_wheel for django-localflavor: started
  Running setup.py bdist_wheel for django-localflavor: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/58/9c/06/0ffd68b0f784cca6570353ff4386b1ad0a38b4e81cff2f34c6
  Running setup.py bdist_wheel for django-model-utils: started
  Running setup.py bdist_wheel for django-model-utils: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/70/dd/fc/18224bdad6ca2838f8dbf63f8647e91169e67c776ab7abdd1e
  Running setup.py bdist_wheel for django-redis: started
  Running setup.py bdist_wheel for django-redis: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/28/1c/41/8c24b4240d28189c7f6bdc241263f28e5eb7f7672f67cfd900
  Running setup.py bdist_wheel for django-smsish: started
  Running setup.py bdist_wheel for django-smsish: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/5a/51/c9/42b9961b60140d92df517d7f097f90ab8f09fb74a7952fd3d5
  Running setup.py bdist_wheel for django-sslify: started
  Running setup.py bdist_wheel for django-sslify: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/20/17/ee/aeaf8a70524e19f8a9abc86778544c4a0927a2e6b39f9fb790
  Running setup.py bdist_wheel for django-sslserver: started
  Running setup.py bdist_wheel for django-sslserver: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/7c/79/45/1bd17abf593834571739cbfb31e2ba923d567c174c53c93199
  Running setup.py bdist_wheel for flower: started
  Running setup.py bdist_wheel for flower: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/12/8f/aa/331a018614655aeddd08814939aee437c0247c83aa0c204bb3
  Running setup.py bdist_wheel for gnureadline: started
  Running setup.py bdist_wheel for gnureadline: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/62/bb/66/0fa9b68ab2150dd04b8bb7084b173776cbf62fb8f819feb876
  Running setup.py bdist_wheel for httplib2: started
  Running setup.py bdist_wheel for httplib2: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/e1/a3/05/e66aad1380335ee0a823c8f1b9006efa577236a24b3cb1eade
  Running setup.py bdist_wheel for ipdb: started
  Running setup.py bdist_wheel for ipdb: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/23/47/8c/fd62cc4019964ccc5d9e379c2e65a70855970113637ee69bc2
  Running setup.py bdist_wheel for Markdown: started
  Running setup.py bdist_wheel for Markdown: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/f3/f7/c7/930d6aac7c31f441a5da8db82b311624f3f33dd6614a9aec3e
  Running setup.py bdist_wheel for MarkupSafe: started
  Running setup.py bdist_wheel for MarkupSafe: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/94/a7/79/f79a998b64c1281cb99fa9bbd33cfc9b8b5775f438218d17a7
  Running setup.py bdist_wheel for newrelic: started
  Running setup.py bdist_wheel for newrelic: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/fd/a0/eb/1cd3ee0b6f50f099c73d6d6543e289d3743a5cc6ccaccda333
  Running setup.py bdist_wheel for pexpect: started
  Running setup.py bdist_wheel for pexpect: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/ea/5b/53/4b65a279e1390ae81febe74f660ce01ef4655c9c1ec9acd9bf
  Running setup.py bdist_wheel for phonenumbers: started
  Running setup.py bdist_wheel for phonenumbers: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/bb/0c/7b/1243872dd52a2f8fa6458b7d688cef61ce3d02b414c73d90bc
  Running setup.py bdist_wheel for psycopg2: started
  Running setup.py bdist_wheel for psycopg2: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/e2/9a/5e/7b620848bbc7cfb9084aafea077be11618c2b5067bd532f329
  Running setup.py bdist_wheel for pycparser: started
  Running setup.py bdist_wheel for pycparser: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/c7/28/31/bac6d0b118c0bdcbf57f9219afdf2e624379c07efa6c769dbc
  Running setup.py bdist_wheel for pysocks: started
  Running setup.py bdist_wheel for pysocks: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/ac/d5/94/b2dc9f65b1f80bd302a22fc8637780677b32366ebe5355897b
  Running setup.py bdist_wheel for PyYAML: started
  Running setup.py bdist_wheel for PyYAML: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/fa/db/f6/dee55793d344f1706dc4a5a693298f0115241d1085cc212364
  Running setup.py bdist_wheel for pyzmq: started
  Running setup.py bdist_wheel for pyzmq: still running...
  Running setup.py bdist_wheel for pyzmq: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/30/a1/9e/35bfffbc9aa6a9d96e8c9ecd436182c8c23ab64985be6c43f3
  Running setup.py bdist_wheel for simplegeneric: started
  Running setup.py bdist_wheel for simplegeneric: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/51/3c/13/2b621669f3ba74b01380aefcc0af0f643bb42360e7248496ed
  Running setup.py bdist_wheel for slackclient: started
  Running setup.py bdist_wheel for slackclient: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/e3/8d/08/1fbfc0e3265fcc1001dc037a85784ed17c861b94fb0583954d
  Running setup.py bdist_wheel for sqlparse: started
  Running setup.py bdist_wheel for sqlparse: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/7b/d4/72/6011bb100dd5fc213164e4bbee13d4e03261dd54ce6a5de6b8
  Running setup.py bdist_wheel for terminado: started
  Running setup.py bdist_wheel for terminado: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/02/4d/5d/5fa953b88bf14feb10f4688b3150bb4f50e2e7655018e889b6
  Running setup.py bdist_wheel for tornado: started
  Running setup.py bdist_wheel for tornado: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/bd/20/c8/6bec1ed7ad88e2fb58333301e8d1f05610231441dcf4740cb5
  Running setup.py bdist_wheel for twilio: started
  Running setup.py bdist_wheel for twilio: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/06/6c/98/9fa0e5af0f3a8c106fa4c42fe54061064a5964ade04673f6a6
  Running setup.py bdist_wheel for websocket-client: started
  Running setup.py bdist_wheel for websocket-client: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/56/d3/af/529917d2f31df813fb0c5445ff88abcd8ee6e450c192b2ed21
  Running setup.py bdist_wheel for enum34: started
  Running setup.py bdist_wheel for enum34: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/1a/4e/a5/bc564dd03d9abe991425c88d88aa8c5c99ad9a733551b69b4e
  Running setup.py bdist_wheel for functools32: started
  Running setup.py bdist_wheel for functools32: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/38/c6/c7/ee17acd621120c302e25c2fa8b3a8b235d5d1137c6ab4c9728
  Running setup.py bdist_wheel for backports.ssl-match-hostname: started
  Running setup.py bdist_wheel for backports.ssl-match-hostname: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/ca/e4/ff/d57f7b2052ddfcf76644f59ad355808f8584d79d4d922601e1
Successfully built anyjson billiard dj-database-url django-jsonfield django-localflavor django-model-utils django-redis django-smsish django-sslify django-sslserver flower gnureadline httplib2 ipdb Markdown MarkupSafe newrelic pexpect phonenumbers psycopg2 pycparser pysocks PyYAML pyzmq simplegeneric slackclient sqlparse terminado tornado twilio websocket-client enum34 functools32 backports.ssl-match-hostname
Failed to build cffi cryptography
Installing collected packages: amqp, anyjson, appnope, pytz, babel, billiard, boto, kombu, celery, pycparser, cffi, idna, pyasn1, six, enum34, ipaddress, cryptography, decorator, dj-database-url, sqlparse, Django, django-debug-toolbar, django-extensions, django-hstore, django-jsonfield, django-localflavor, django-model-utils, redis, django-redis, PyYAML, djangorestframework, django-rest-swagger, django-smsish, django-sslify, django-sslserver, PyJWT, djangorestframework-jwt, mccabe, pep8, pyflakes, flake8, backports.ssl-match-hostname, certifi, tornado, futures, flower, gnureadline, gunicorn, httplib2, ipython-genutils, traitlets, path.py, pickleshare, simplegeneric, ptyprocess, pexpect, ipython, ipdb, jupyter-core, pyzmq, jupyter-client, ipykernel, functools32, jsonschema, nbformat, pygments, mistune, MarkupSafe, jinja2, nbconvert, terminado, notebook, ipywidgets, jupyter-console, qtconsole, jupyter, Markdown, newrelic, phonenumbers, psycopg2, pyOpenSSL, pysocks, requests, websocket-client, slackclient, stripe, twilio, whitenoise
  Running setup.py install for cffi: started
    Running setup.py install for cffi: finished with status 'error'
    Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FW74VY/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EUmSPJ-record/install-record.txt --single-version-externally-managed --compile:
    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
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/cparser.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/gc_weakref.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/__init__.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/verifier.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/recompiler.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/api.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/model.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/lock.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/commontypes.py -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-x86_64-2.7/cffi
    copying cffi/_embedding.h -> build/lib.linux-x86_64-2.7/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/c
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/app/.heroku/python/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
                     ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FW74VY/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EUmSPJ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-FW74VY/cffi
You are using pip version 8.0.2, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
ERROR: Service 'web' failed to build: The command '/bin/sh -c /app/.heroku/python/bin/pip install -r requirements.txt' returned a non-zero code: 1

@kennethreitz
Copy link
Contributor

@RyanBalfanz this buildpack is not used in the heroku-docker plugin workflow, at this time.

@RyanBalfanz
Copy link

@kennethreitz, thanks for the reply. I was able to get heroku/python-getting-started working with heroku-docker anyway, which is nice.

Any idea when this buildpack will officially be supported? Or if it is even on the roadmap at all?

@kennethreitz
Copy link
Contributor

@RyanBalfanz at this time, the heroku-docker plugin and accompanying Docker image are entirely separate projects from this one.

At one point in time, during the first iteration, I did have the Python Docker image simply download and utilize this buildpack during its build. This worked well, and is certianly an option (you can look in the git history of the repository for an example Dockerfile to accomplish this). However — simply running effectively the entire build as a single step in Docker takes away from many of the benefits of using Docker in the first place — so, we decided as a team to build each Dockerfile minimally and from scratch.

At this point in time, I personally assume (haven't looked at any numbers) that the Python Docker image isn't receiving any widespread usage, as it's still a fairly early-stage project. In the future, as Heroku's Docker story evolves, I'm sure much if not all of the above story will change.

For example: support for Python 3 was added into the Python Docker Image just a few weeks ago — because a user (finally) requested it.

@RyanBalfanz
Copy link

@kennethreitz Got it, thanks!

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

3 participants