0
votes

my scope is to run a python script (it does scrap text from websites and save it in csv files) in the cloud through cron job. For this I chose Heroku.

I am stuck because when I try to deploy the worker I get a Push rejection.

Here is what i do: I put my scrapit.py and Procfile ('worker: node scrapit.py') in a directory.

Then after I create an app in heroku, I send the following commands from the directory of above:

$ heroku login
$ git init
$ heroku git:remote -a app-name-on-heroku
$ git add .
$ git commit -am "nth time :("
$ git push heroku master

I get the following message:

Counting objects: 41, done. Delta compression using up to 4 threads. Compressing objects: 100% (36/36), done. Writing objects: 100% (41/41), 12.97 KiB | 0 bytes/s, done. Total 41 (delta 6), 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 app-name-on-heroku. remote: To https://git.heroku.com/app-name-on-heroku.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/app-name-on-heroku.git'

after the error I sent this command:

heroku buildpacks:set heroku/python

but still the push gets rejected

1
do I need a requirement.txt? - user3755529

1 Answers

2
votes

Every Heroku buildpack specifies a bin/detect file, which lets the platform know if that buildpack can be used with that app or not.

The python buildpack requires either: requirements.txt, setup.py or Pipfile to be present.
You need to create (and properly configure) one of those files to be able to have your python app built.