App not compatible with buildpack - Heroku

2020-02-26 15:15发布

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?

标签: heroku
7条回答
等我变得足够好
2楼-- · 2020-02-26 15:42

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.

查看更多
该账号已被封号
3楼-- · 2020-02-26 15:43

You can specify the buildpack for python by this method

CLI Installation

heroku buildpacks:set https://github.com/heroku/heroku-buildpack-python.git
查看更多
Emotional °昔
4楼-- · 2020-02-26 15:46

add pipfile & procfile, & *commit them , this solved for me :)

u can see these file on this heroku sample : link

heroku buildpack on github : link

查看更多
小情绪 Triste *
5楼-- · 2020-02-26 15:50

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.

查看更多
爷、活的狠高调
6楼-- · 2020-02-26 15:51

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 within my-project for Heroku to work...

查看更多
Animai°情兽
7楼-- · 2020-02-26 15:53

Step 1) First setup the buildpack (programming-language )

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

Step 2) git init and currently used directory is different, so this error is still thrown "App not compatible with buildpack:"

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

So move the files accordingly such that all the file are present under the same folder and then run

git push heroku master

--happy coding!

查看更多
登录 后发表回答