首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法将Python3Flask应用程序推上Heroku

无法将Python3Flask应用程序推上Heroku
EN

Stack Overflow用户
提问于 2015-07-05 11:06:26
回答 1查看 1.1K关注 0票数 2

我有一个简单而直接的Python应用程序。我正试着把它部署到Heroku。我正在使用Python 3运行时。我可以使用foreman start在本地运行它,但是它无法在Heroku上构建并拒绝它。

这是日志:

代码语言:javascript
复制
Counting objects: 29, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (25/25), done.
Writing objects: 100% (29/29), 6.08 KiB | 0 bytes/s, done.
Total 29 (delta 11), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing runtime (python-3.4.3)
remote: -----> Installing dependencies with pip
remote:        Collecting Flask==0.9 (from -r requirements.txt (line 1))
remote:          Downloading Flask-0.9.tar.gz (481kB)
remote:            Complete output from command python setup.py egg_info:
remote:            Traceback (most recent call last):
remote:              File "<string>", line 20, in <module>
remote:              File "/tmp/pip-build-r95ud3px/Flask/setup.py", line 62
remote:                print "Audit requires PyFlakes installed in your system."
remote:                                                                        ^
remote:            SyntaxError: Missing parentheses in call to 'print'
remote:            
remote:            ----------------------------------------
remote: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-r95ud3px/Flask
remote: 
remote:  !     Push rejected, failed to compile Python app
remote: 
remote: Verifying deploy....
remote: 
remote: !   Push rejected to xxxxxxxxxxxxxxxxxx.
remote: 
To https://git.heroku.com/xxxxxxxxxxxxxxxxxx.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/xxxxxxxxxxxxxxxxxx.git'

那么,我到底做错了什么?

编辑:

档案: Procfile

代码语言:javascript
复制
web: gunicorn app:app --log-file=-

app.py是主要的应用程序。

文件: requirements.txt

代码语言:javascript
复制
Flask==0.9
Jinja2==2.6
Werkzeug==0.8.3
gunicorn==0.17.2

文件: runtime.txt

代码语言:javascript
复制
python-3.4.3
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-05 11:38:16

烧瓶版本0.9不支持文档 3,因为它在文档中读取

烧瓶0.10和Werkzeug 0.9是引入Python3支持的第一个版本。

因此,您应该使用瓶0.10.1。修改您的requirements.txt如下:

代码语言:javascript
复制
Flask==0.10.1
Werkzeug==0.10.4
票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31229728

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档