Push rejeitado, não conseguiu compilar o aplicativo Python

Estou recebendo um erro rejeitado ao tentar implantar um aplicativo do Django no Heroku. Eu olhei para possíveis soluções aqui:

  1. Rejeição do Heroku rejeitada, falha ao compilar o aplicativo Python / django (Python 2.7)

  2. Erro ao empurrar o projeto Django para o Heroku

Mas nem funcionou para mim.

Este é o meu stream de iniciar o impulso para heroku:

git push heroku master Initializing repository, done. Counting objects: 7024, done. Delta compression using up to 4 threads. Compressing objects: 100% (5915/5915), done. Writing objects: 100% (7024/7024), 8.77 MiB | 104 KiB/s, done. Total 7024 (delta 2183), reused 0 (delta 0) -----> Python app detected -----> No runtime.txt provided; assuming python-2.7.6. -----> Preparing Python runtime (python-2.7.6) -----> Installing Setuptools (2.1) -----> Installing Pip (1.5.4) -----> Installing dependencies using Pip (1.5.4) Downloading/unpacking Django==1.6.2 (from -r requirements.txt (line 1)) Downloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 2)) argparse an externally hosted file and may be unreliable Running setup.py (path:/tmp/pip_build_u16439/argparse/setup.py) egg_info for package argparse no previously-included directories found matching 'doc/_build' no previously-included directories found matching 'env24' no previously-included directories found matching 'env25' no previously-included directories found matching 'env26' no previously-included directories found matching 'env27' Downloading/unpacking distribute==0.6.24 (from -r requirements.txt (line 3)) Running setup.py (path:/tmp/pip_build_u16439/distribute/setup.py) egg_info for package distribute warning: no files found matching 'Makefile' under directory 'docs' warning: no files found matching 'indexsidebar.html' under directory 'docs' Downloading/unpacking dj-database-url==0.3.0 (from -r requirements.txt (line 4)) Downloading dj_database_url-0.3.0-py2.py3-none-any.whl Downloading/unpacking dj-static==0.0.5 (from -r requirements.txt (line 5)) Downloading dj-static-0.0.5.tar.gz Running setup.py (path:/tmp/pip_build_u16439/dj-static/setup.py) egg_info for package dj-static Downloading/unpacking django-toolbelt==0.0.1 (from -r requirements.txt (line 6)) Downloading django-toolbelt-0.0.1.tar.gz Running setup.py (path:/tmp/pip_build_u16439/django-toolbelt/setup.py) egg_info for package django-toolbelt Downloading/unpacking gunicorn==18.0 (from -r requirements.txt (line 7)) Running setup.py (path:/tmp/pip_build_u16439/gunicorn/setup.py) egg_info for package gunicorn Downloading/unpacking psycopg2==2.5.2 (from -r requirements.txt (line 8)) Running setup.py (path:/tmp/pip_build_u16439/psycopg2/setup.py) egg_info for package psycopg2 Downloading/unpacking pystache==0.5.3 (from -r requirements.txt (line 9)) Running setup.py (path:/tmp/pip_build_u16439/pystache/setup.py) egg_info for package pystache pystache: using: version '2.1' of  Downloading/unpacking static==1.0.2 (from -r requirements.txt (line 10)) Downloading static-1.0.2.tar.gz Running setup.py (path:/tmp/pip_build_u16439/static/setup.py) egg_info for package static Installing collected packages: Django, argparse, distribute, dj-database-url, dj-static, django-toolbelt, gunicorn, psycopg2, pystache, static Running setup.py install for argparse no previously-included directories found matching 'doc/_build' no previously-included directories found matching 'env24' no previously-included directories found matching 'env25' no previously-included directories found matching 'env26' no previously-included directories found matching 'env27' Running setup.py install for distribute Before install bootstrap. Scanning installed packages Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg Egg installation Patching... Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32 Patched done. Relaunching... Traceback (most recent call last): File "", line 1, in  NameError: name 'install' is not defined Complete output from command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile: Before install bootstrap. Scanning installed packages Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg Egg installation Patching... Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32 Patched done. Relaunching... Traceback (most recent call last): File "", line 1, in  NameError: name 'install' is not defined ---------------------------------------- Cleaning up... Command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_u16439/distribute Storing debug log for failure in /app/.pip/pip.log ! Push rejected, failed to compile Python app 

Meus requirements.txt

 Django==1.6.2 argparse==1.2.1 distribute==0.6.24 dj-database-url==0.3.0 dj-static==0.0.5 django-toolbelt==0.0.1 gunicorn==18.0 psycopg2==2.5.2 pystache==0.5.3 static==1.0.2 wsgiref==0.1.2 

Procfile

 web: gunicorn app.wsgi 

Eu segui as instruções do site da Heroku. Alguma idéia do que estou perdendo?

Este é aparentemente um bug no pacote de distribute , que parece não ser corrigido:

O Distribute agora é considerado obsoleto e substituído por setuptools. Eu sugiro replace ‘distribua == 0.6.28’ em requirements.txt com ‘setuptools == 1.0’ ou similar. As versões mais recentes do pip (> = 1.4) e setuptools (> = 0.7) têm melhor suporte para o código unificado e atualizações e procuram evitar problemas como o encontrado aqui.

Este é um problema com o pacote distribute reprovado. Veja Bug # 91 no Bitbucket.

Substituir distribute==0.6.24 com setuptools==0.7.3 em seu arquivo requirements.txt deve remediar seu problema.

Também tem problema semelhante com empurrando para heroku:

 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Python app detected remote: -----> Installing python-2.7.13 remote: $ pip install -r requirements.txt remote: Collecting Django==1.10 (from -r /tmp/build_9bc106d48b24e071b3b58 3f8cd5119f8/requirements.txt (line 1)) remote: Downloading Django-1.10-py2.py3-none-any.whl (6.8MB) remote: Collecting get==0.0.0 (from -r /tmp/build_9bc106d48b24e071b3b583f 8cd5119f8/requirements.txt (line 2)) remote: Downloading get-0.0.0.tar.gz remote: Complete output from command python setup.py egg_info: remote: Traceback (most recent call last): remote: File "", line 1, in  remote: IOError: [Errno 21] Is a directory: '/tmp/pip-build-h774_8/ge t/setup.py' remote: remote: ---------------------------------------- remote: Command "python setup.py egg_info" failed with error code 1 in /t mp/pip-build-h774_8/get/ remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy.... remote: remote: ! Push rejected to enigmatic-bastion-36926. remote: To https://git.heroku.com/enigmatic-bastion-36926.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/enigmatic-bastion-369 26.git 

Meu requirements.txt:

 Django==1.10 get==0.0.0 gunicorn==19.6.0 olefile==0.44 Pillow==4.0.0 post==0.0.0 public==0.0.0 query-string==0.0.0 request==0.0.0 requests==2.12.4 setupfiles==0.0.0 virtualenv==15.1.0 whitenoise==3.2