Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to detect set buildpack when it's just been set for Python?

Tags:

heroku

I've been trying to push a django web app to heroku with no avail because of the following error:

(venv)douglaswong@Douglas-MacBook-Pro ~/testing (testing)$ git push heroku master
Counting objects: 53, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (35/35), done.
Writing objects: 100% (53/53), 41.11 KiB | 0 bytes/s, done.
Total 53 (delta 12), reused 48 (delta 11)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching set buildpack git://github.com/heroku/heroku-buildpack-python.git... done
remote:
remote:  !     Push rejected, failed to detect set buildpack git://github.com/heroku/heroku-buildpack-python.git
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: Verifying deploy...
remote:
remote: !   Push rejected to sleepy-spire-9508.
remote:
To https://git.heroku.com/sleepy-spire-9508.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sleepy-spire-9508.git'

It says it failed to detect set buildpack. However, I had set it with

(venv)douglaswong@Douglas-MacBook-Pro ~/testing (testing)$ heroku create --buildpack git://github.com/heroku/heroku-buildpack-python.git
Creating fierce-waters-9228... done, stack is cedar-14
Buildpack set. Next release on fierce-waters-9228 will use git://github.com/heroku/heroku-buildpack-python.git.
https://fierce-waters-9228.herokuapp.com/ | https://git.heroku.com/fierce-waters-9228.git

What are some possible causes for this? I currently have these files in my root directory if it makes a difference:

Procfile         angellistJob     venv
README.md        requirements.txt

Any advice is appreciated, thank you!

like image 905
Douglas Wong Avatar asked Nov 24 '15 07:11

Douglas Wong


3 Answers

I had a similar issue. For me the problem was that I forgot to commit the changes to my local repo.

Also, make sure you commit to the same branch you're pushing to.

Hope this helps!

like image 61
LuisCien Avatar answered Nov 04 '22 19:11

LuisCien


Just to bring to the notice of anyone who has the same problem. Even I had the same problem and was committing to the exact branch I was pushing to. However, since I didn't have the requirements.txt file, the push was being rejected.
So, also make sure you have the Procfile and the requirements.txt before pushing to heroku.

like image 5
Raunaq Kochar Avatar answered Nov 04 '22 19:11

Raunaq Kochar


I found out that this issue might occur for two reasons:

  • There isn't the requirements.txt file in the current directory.
  • You are pushing on a different branch.

On the other hand you could set the respective buildpacks at the moment of create the app.

heroku create myapp --buildpack heroku/python

like image 2
Daniel Azocar Avatar answered Nov 04 '22 17:11

Daniel Azocar