I'm trying to deploy to heroku and have my requirements.txt, Procfile, and app.py file in the root directory. I created my heroku instance with heroku create --buildpack heroku/python but I still get
remote: ! Push rejected, failed to detect set buildpack heroku/python
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to desolate-basin-41623.
remote:
I've gone onto several forums and can't really seem to figure out why that is. I'm also pushing from the master branch, which seems to be something people overlook.
I did, however, I initialized my git instance above the root directory.
I figured it out, it turns out that you do have to have github initialized inside of your root.
Related
Every time i try to deploy my bot it shows me this error:
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/python
-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
! Push failed
I have Procfile, requirments.txt, runtime.txt.
The requirments.txt:
discord
The runtime.txt:
python-3.10.3
What should i do?
I fixed it, because i missed a letter in requirements.txt file name.
I followed the initial setup at the Gemfurey Dev docs and when trying to push to the fury master branch, the build is triggered and fails with SyntaxError
remote: Resolving deltas: 100% (86/86)
remote: Initializing build: done.
remote: -----> Building package...
remote: Python package build detected
remote: File "setup.py", line 17
remote: README: str = Path(HERE, "README.rst").read_text(encoding='utf-8')
remote: ^
remote: SyntaxError: invalid syntax
remote: -----> Problem building package!
I assume that the problem here is an incorrect version of python being run to build the package. I tried to check whether it is possible to configure the build to use the correct python version -- in this case 3.6 -- but there is no hint of such possibility.
Anything I can do to make these automatic builds work or is my only option to build the package locally and upload it to the fury index?
Thanks!
Unfortunately, ​Gemfury's current "git push" builder only supports Python 2 and there's no way to configure the runtime. If you're limited by this, I suggest building it locally or using another CI/CD solution to build and push it into your Gemfury account.
I am a novice and don't understand many of the concepts, so excuse me if there are some ambiguities or plain fallacies in my statements and questions.
I am writing a web app using Flask python framework. I have already tested it on localhost. Now I want to deploy it to heroku's webserver.
Here is the folder where the main files are stored:
static #this is a folder
templates #this is a folder
Procfile
requirements.txt
runtime.txt
app.py
Now here are the contents of Procfile, requirements.txt and runtime.txt respectively:
Procfile:
web: gunicorn app:app
requirements.txt:
Flask==0.12.2
gunicorn==19.7.1
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
Werkzeug==0.12.2
runtime.txt:
python-2.7.1
Now, it was python-3.5.1 in runtime.txt , before I had the problem but now during debugging I've left it as 2.7.1, because there's another problem I find.
Now when I try to execute the command: git push heroku master, the following ouptut is generated:
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (13/13), 1.95 KiB | 0 bytes/s, done.
Total 13 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.5.1
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote:
/app/tmp/buildpacks/{somelonghash}/bin/steps/pip-
install: line 7: /app/.heroku/python/bin/pip: No such file or
directory
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to joecrownwebapp.
remote:
To https://git.heroku.com/joecrownwebapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
'https://git.heroku.com/joecrownwebapp.git'
Where {somelonghash} was some long hash which for the purposes of this question I've removed. Now as you can see first the app is being deployed with python-3.5.1 which is strange given the fact that I've specified in runtime.txt that the runtime should be for example 2.7.1. Now we also see that pip is being installed and thereafter the requirements are being installed with pip and that is where the problem occurs.
The first question that comes to my mind is: Where exactly is this "/app/.heroku/python/bin/pip:" directory supposed to be, or for that matter "/app/tmp/buildpacks/{somelonghash}/bin/steps/pip-
install"?
Are they somewhere on my machine? (I figure not because if they are unix-based pathnames, then app should be directly under root, but I dont have such a folder)
If they are not on my machine where are they, how can I locate them and examine them. Are they somewhere on the Heroku server. If so, where does my problem arise from? Why is my runtime.txt disregarded?
Any ideas would be greatly appreciated!
When I try to push my django app to heroku it fails right at the beginning:
remote: -----> Python app detected
remote: -----> Installing python-3.5.1
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: /app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/
bin/steps/pip-install: line 5: /app/.heroku/python/bin/pip:
No such file or directory
remote: ! Push rejected, failed to compile Python app.
remote:
I apparently do something wrong, but I did the same thing many times before. What's wrong?
I had this exact same problem yesterday and it was really frustrating as I had deployed to Django before under the exact same settings with no problem.
In your runtime.txt file change it from:
python-3.5.1
to
python-3.6.1
Why changing the Python version on Heroku matters beats me but it worked like a charm.
I can't deploy my Flask app to Heroku...
I've searched in every thread I can and nothing worked for me : add a runtime.txt, set a buildpack. I don't know what can be wrong now.
Here is my root directory for the app :
Project
- .git
- Procfile
- Readme.md
- app
- config.py
- requirements.txt
- runtime.txt
- web.py
Here's the content of requirements.txt:
appdirs==1.4.3
click==6.7
Flask==0.12.1
Flask-WTF==0.14.2
itsdangerous==0.24
Jinja2==2.9.5
MarkupSafe==1.0
packaging==16.8
pyparsing==2.2.0
six==1.10.0
Werkzeug==0.12.1
WTForms==2.1
The Procfile :
web: python web.py
And the runtime.txt:
python-2.7.13
When I do git push heroku master, it prints:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to appname.
remote:
I tried to add a buildpack with heroku buildpacks:add heroku/Python but then it says that it can't detect app for python buildpack.
What could I possibly did wrong ?
Change requirements.py to requirements.txt.
If you're using the default Python 2.7.13 you shouldn't need a runtime.txt. You'd think that specifying the runtime would trigger the language detection but even without packages to install, Heroku requires an empty requirements.txt.
I was spend time with a very similar error.
In my case, i tried to deploy a django app.
I just run these commands to setup the buildpack
heroku login
heroku create --stack cedar --buildpack git://github.com/heroku/heroku-buildpack-python.git
heroku config:add BUILDPACK_URL=git#github.com:heroku/heroku-buildpack-python.git#purge
heroku config:set HEROKU=1
I decided to post this here because it took me a long time to get these tips
edit the content of your Procfile to
web: gunicorn web:app --log-file=-
I assume your web.py file is contained in your project's root folder i.e you see it once you enter your project's "Project" folder.
Otherwise, if it is contained in the app folder then use
web: gunicorn app.web:app --log-file=-
I also run into similar problem. I was able to fix it by adding the runtime.txt
just put the version of the python you are using in the runtime.txt
python-2.7.14
I'm late the to party but if you already have a requirements.txt file and you're getting this error, try adding a Procfile like shown here in the documentation:
https://devcenter.heroku.com/articles/getting-started-with-python#define-a-procfile