简体   繁体   English

在Heroku上部署Python App

[英]Deployment of Python App on Heroku

I created my first chatbot with Chatterbot library. 我使用Chatterbot库创建了我的第一个chatbot。 Now I want to deploy it through Heroku, but this is impossible. 现在,我想通过Heroku部署它,但这是不可能的。

My chatbot is composed of some files (py, csv, yml, json, txt). 我的聊天机器人由一些文件(py,csv,yml,json,txt)组成。 This is the structure: 结构如下:

botusers (csv file) botusers(csv文件)
Magghy (py file) 玛吉(py文件)
magghybot (py file) magghybot(py文件)
Procfile 程序文件
Requirements (txt file) 要求(txt文件)
telegramtoken (txt file) 电报令牌(txt文件)
conversation.yml (in folder named lang) talk.yml(在名为lang的文件夹中)
math_words.json (in folder named lang) math_words.json(在名为lang的文件夹中)

I created a "Procfile" (worker: python magghybot.py) and "Requirements.txt" 我创建了一个“ Procfile”(工作者:python magghybot.py)和“ Requirements.txt”

Then, I create my Heroku Profile and I tried to deploy my project but on terminal I have this problem: 然后,创建我的Heroku配置文件,并尝试部署我的项目,但是在终端上我遇到了这个问题:

Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (13/13), 5.22 KiB | 0 bytes/s, done.
Total 13 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> App not compatible with buildpack: https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to magghy.
remote: 
To https://git.heroku.com/magghy.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/magghy.git'

What am I missing? 我想念什么?

You need to set the Python runtime in a runtime.txt file. 您需要在runtime.txt文件中设置Python运行时。 See here for more details. 有关更多详细信息,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM