Flask - 由于Pip失败而无法部署应用程序

时间:2014-03-28 08:31:48

标签: python heroku flask pip

我已经在heroku上部署了几个应用程序用于教育目的。今天我使用flask创建了一个新应用程序,我像以前一样按照heroku网站上的说明操作。问题发生在我需要使用pip来安装其他东西的步骤

(venv)kiddo@kiddo-LIFEBOOK-LH531:~/Documents/Projects/workspace/hellowork$ pip install Flask gunicorn
Downloading/unpacking Flask
  Downloading Flask-0.10.1.tar.gz (544Kb): 544Kb downloaded
  Running setup.py egg_info for package Flask

    warning: no files found matching '*' under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'examples'
    warning: no previously-included files matching '*.pyo' found under directory 'examples'
    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'docs/_themes/.git' ...

.....和其他人一起继续。从现在开始,我无法在heroku上部署,因为它总是会弹出额外的错误以及上面的内容:

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.1395994594.37

   Patched done.

   Relaunching...

   Traceback (most recent call last):

     File "<string>", line 1, in <module>

   NameError: name 'install' is not defined

   ----------------------------------------
   Cleaning up...
   Command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u56661/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-y13sLM-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_u56661/distribute
   Storing debug log for failure in /app/.pip/pip.log

 !     Push rejected, failed to compile Python app

To git@heroku.com:quiet-meadow-5679.git

我的要求.txt:

Flask==0.10.1
Jinja2==2.7.2
MarkupSafe==0.19
Werkzeug==0.9.4
argparse==1.2.1
distribute==0.6.24
gunicorn==18.0
itsdangerous==0.23
wsgiref==0.1.2

我使用ubuntu,每个软件包都是最新的。我之前从未遇到过这个问题,而且我已经花了几个小时。任何想法如何解决它将不胜感激。

应用程序在本地主机上运行正常,但是工头顺便说一句。

谢谢

2 个答案:

答案 0 :(得分:1)

我联系了heroku支持,这是我本地软件包和heruku服务器软件包之间的问题。如何修复它只是从requirements.txt

中删除distribute == 0.6.24

他们还更新了说明页面,因此我们需要更新到每个软件包的最新版本才能部署该应用程序。

答案 1 :(得分:0)

您是否尝试过对Heroku的支持?看起来Heroku可能在发生这种情况时遇到了API问题。您应该联系支持部门(并尝试再次部署)。