0

I'm trying to deploy a python script, but I get this error

Failed to detect app matching https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz buildpack

What files I have right now:

automation.py

A simple python script which imports praw, time, os and inspect.

requirements.txt

As described in the Heroku documents, I have created this file by running pip freeze > requirements.txt, containing:

astroid==1.5.2
colorama==0.3.8
isort==4.2.5
lazy-object-proxy==1.2.2
mccabe==0.6.1
praw==4.4.1.dev0
prawcore==0.10.1
pylint==1.7.1
requests==2.13.0
six==1.10.0
update-checker==0.16
wrapt==1.10.10

runtime.txt

Again as described in Heroku documents, this file contains the runtime for my script, containing:

python-3.6.0

I have changed my remote to heroku, added all files, commited and pushed to heroku master, but I get the error mentioned in the beginning. Is there something I'm doing wrong? I have seen this answer, but I'm not convinced. Would like to avoid any frameworks if possible.

git ls-files output

.gitignore
LICENSE
README.md
requirements.txt
runtime.txt
automation.py
5
  • Hm. I just put up a no-framework script with no problem. One thing I noticed is that the docs reference python-3.6.1 instead of python-3.6.0. Have you tried switching? Also, to sanity check, can you put the output of git ls-files and the Procfile? Commented May 5, 2017 at 14:05
  • @bimsapi I added the ls-files, but I have no Procfile. Is it requiered? Commented May 5, 2017 at 14:37
  • 1
    Yes, pretty sure Procfile is required - that's how Heroku knows what script to run for your app. Without it, Heroku doesn't know automation.py is anything special. Note though - if automation.py doesn't listen on any port, define the process name as worker or something. If you define it as web Heroku will expect it to bind to an externally visible port (not on localhost). If Heroku doesn't detect a port bind, it reports the app as failed to start. Commented May 5, 2017 at 15:12
  • Glad that was it. Out of curiosity, is the app just a batch processor, or does it listen for web requests, too? Commented May 6, 2017 at 1:15
  • @bimsapi The app is a Reddit bot using PRAW. It does react to messages and comments, so I guess it listens to web requests. Another problem was presented, and the Heroku creates two workers for some reason, but I didn't look for the root of the problem yet. Commented May 8, 2017 at 9:02

1 Answer 1

1

In addition to runtime.txt and requirements.txt, a Procfile is required - that's how Heroku knows what script to run for your app. Without it, Heroku doesn't know automation.py is anything special. Note though - if your script doesn't listen on any port, define the process name as "worker" or anything other than "web". If you define it as "web" Heroku will expect it to bind to an externally visible port (not on localhost). If Heroku doesn't detect a port bind within 60 seconds, it reports the app as failed to start

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.