0

我正在尝试在 Heroku 上部署 JustPy 应用程序。我都是新手。

基本代码,来自https://justpy.io/tutorial/getting_started/

# saved as app.py
import justpy as jp
app = jp.app # added for deployment

def hello_world():
    wp = jp.WebPage()
    jp.Hello(a=wp)
    return wp

jp.justpy(hello_world)

要部署到 Heroku 帐户,请从以下网址获取 Heroku 工具:https ://devcenter.heroku.com/articles/heroku-cli

从您的项目文件夹中:

pip install gunicorn
pip freeze > requirements.txt
# create Procfile web:- gunicorn app:app
# create runtime.txt:- Python 3.9.5 
heroku login
heroku create justpyhi
git init
git add .   
git config --global user.email "myemail@hotmail.com"
git config --global user.name "whateverusername"
git commit -m "first commit"
heroku git:remote --app justpyhi
git push heroku master
heroku open

...我收到以下错误:

Starting process with command `gunicorn mainheroku l`
app[web.1]: bash: gunicorn: command not found
heroku[web.1]: Process exited with status 127
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: State changed from crashed to starting
app[api]: Build succeeded

[更新:]我得到这个进一步的错误:

-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/python
-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
       More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
 !     Push failed

我究竟做错了什么?感谢所有帮助!

4

0 回答 0