When I run git push heroku master
this is what I get:
C:\Users\Emanuele-PC\Desktop\project-mm-beta>git push heroku master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 505 bytes | 0 bytes/s, done.
Total 3 (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 project-mm-beta.
remote:
To https://git.heroku.com/project-mm-beta.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/project-mm-beta.git'
The code I am trying to deploy is just one file (it's a test because it's my first time using Heroku) and it's written in Python. I have already set the buildpack (python) but it still doesn't work. How can I solve?
I was getting this error because I was making changes to a different branch. So I was working of a feature branch, then running
git push heroku master
. My changes had not been merged into my master branch, so thus the error. Once I merged in the Procfile to master I was able to push the changes up to heroku.You can specify the buildpack for python by this method
CLI Installation
add pipfile & procfile, & *commit them , this solved for me :)
u can see these file on this heroku sample : link
heroku buildpack on github : link
The Heroku Python Support will be applied to applications only when the application has a Pipfile or
requirements.txt
in the root directory.Visit the documentation to get detailed instructions.
I just found out... It's quite a silly issue. Make sure the git repo is initialized within the project root folder. Suppose the project is a Django app and the project folder created by Django is
my-project
, the git repo needs to be initialized right withinmy-project
for Heroku to work...For example :
heroku buildpacks:set heroku/nodejs
Check for more info here : https://devcenter.heroku.com/articles/buildpacks
If the issue still exists, then follow next step
For example :
git init
command was used executed at :- C:/sample_folder/But modules and package.json is under nested sub-folder :-
C:/sample_folder/nodejs_app/package.json
git push heroku master
--happy coding!