我正在尝试部署一个简单的#34; hello world"应用烧瓶到heroku。这是应用程序本身的代码(名为hello.py):
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World!'
if __name__=="__main__":
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port)
这是procfile:
web: gunicorn hello:app
当我尝试使用Windows命令提示符部署我的应用程序时,它会失败。我已经提取了我认为相关的输出部分
remote: Running setup.py install for Werkzeug
remote:
remote:
remote: Running setup.py install for scipy
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-build-oRWdEw/scipy/setup.py", line 237, in <
module>
remote: setup_package()
remote: File "/tmp/pip-build-oRWdEw/scipy/setup.py", line 225, in s
etup_package
remote: from numpy.distutils.core import setup
remote: ImportError: No module named numpy.distutils.core
remote: Complete output from command /app/.heroku/python/bin/python -
c "import setuptools, tokenize;__file__='/tmp/pip-build-oRWdEw/scipy/setup.py';e
xec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n
'), __file__, 'exec'))" install --record /tmp/pip-_HDaE9-record/install-record.t
xt --single-version-externally-managed --compile:
remote: Traceback (most recent call last):
remote:
remote: File "<string>", line 1, in <module>
remote:
remote: File "/tmp/pip-build-oRWdEw/scipy/setup.py", line 237, in <
module>
remote:
remote: setup_package()
remote:
remote: File "/tmp/pip-build-oRWdEw/scipy/setup.py", line 225, in s
etup_package
remote:
remote: from numpy.distutils.core import setup
remote:
remote: ImportError: No module named numpy.distutils.core
remote:
remote: ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -c "import setuptools
, tokenize;__file__='/tmp/pip-build-oRWdEw/scipy/setup.py';exec(compile(getattr(
tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'
))" install --record /tmp/pip-_HDaE9-record/install-record.txt --single-version-
externally-managed --compile" failed with error code 1 in /tmp/pip-build-oRWdEw/
scipy
remote:
remote: ! Push rejected, failed to compile Python app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to cs242-chaya2-final.
remote:
Warning: Your console font probably doesn't support Unicode. If you experience s
trange characters in the output, consider switching to a TrueType font such as L
ucida Console!
To https://git.heroku.com/cs242-chaya2-final.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/cs242-chaya2-final.gi
t'
(venv) C:\Users\Kamal\Documents\School\Spring2015\CS242\cs242-chaya2-final>
我认为numpy.distutils.core导致错误,我不知道如何解决这个问题,有人可以帮助我吗?
这是我的requirements.txt:
beautifulsoup4==4.3.2
elasticsearch==1.4.0
Flask==0.10.1
Flask-Login==0.2.11
itsdangerous==0.24
Jinja2==2.7.3
MarkupSafe==0.23
numpy==1.6.2
scipy==0.14.0
urllib3==1.10.2
virtualenv==12.0.7
Werkzeug==0.10.1