我成功安装了gunicorn:
remote: -----> Removing .DS_Store files
remote: -----> Python app detected
remote: -----> Installing dependencies with pip
remote: Collecting gunicorn==19.0.0 (from -r requirements.txt (line 1))
remote: Downloading gunicorn-19.0.0.tar.gz (382kB)
remote: Installing collected packages: gunicorn
remote: Running setup.py install for gunicorn
remote: Successfully installed gunicorn-19.0.0
Run Code Online (Sandbox Code Playgroud)
我的Procfile:
web: gunicorn myapp:app --log-file=-
Run Code Online (Sandbox Code Playgroud)
但部署时应用程序崩溃:
bash: gunicorn: command not found
Run Code Online (Sandbox Code Playgroud)
我尝试添加heroku python buildpack,但没有运气.如果我回滚到先前的提交(其中requirements.txt和Procile都没有改变),它的工作原理如下:
heroku/web.1: Starting process with command `gunicorn myapp:app --log-file=-`
app/web.1: 2015-10-08 17:04:18 [3] [INFO] Listening at: http://0.0.0.0:51854 (3)
Run Code Online (Sandbox Code Playgroud)
Qua*_*ong 70
确保gunicorn在你的requirements.txt
max*_*o87 11
在远程卸载所有需求并重新安装后,问题似乎已得到解决.
我错过了 heroku/python buildpack,所以我去了仪表板,然后:
Settings -> Add buildpack -> heroku/python
Run Code Online (Sandbox Code Playgroud)
小智 6
安装gunicorn在你的虚拟环境中
pip install gunicorn
Run Code Online (Sandbox Code Playgroud)
然后更新你的requirements.txt文件
pip freeze > requirements.txt
Run Code Online (Sandbox Code Playgroud)
小智 5
如果您在项目根目录中同时具有Requirements.txt和Pipfile,那么我建议删除Pipfile,并将所有需求列在Requirements.txt文件中(包括gunicorn)。
然后将显示:“从pip安装需求”,并且将安装requirements.txt中列出的所有需求。
| 归档时间: |
|
| 查看次数: |
23009 次 |
| 最近记录: |