I need some help to solve this. I have others websites in another heroku account, but I 'm not getting in my empty account. I am using python3.5.0 (but I tried change python version without sucess) and Django 1.10. I have in my git repositore, runtime.txt, procfile.txt, but I'm having this problem: (terminal)
Counting objects: 105, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (97/97), done.
Writing objects: 100% (105/105), 2.22 MiB | 113.00 KiB/s, done.
Total 105 (delta 34), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.5.0
remote: ! Requested runtime (python-3.5.0) is not available for this stack (heroku-16).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to confiam2.
remote:
To https://git.heroku.com/confiam2.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/
How can I solve this? I tried to update heroku version, and change python version. Without sucess. Very thanks who can help me.
The error code is this -
Requested runtime (python-3.5.0) is not available for this stack (heroku-16).
If you visit the support page suggested, you will see that Python 3.6.2 and 2.7.13 are the only supported runtimes. Why would you expect 3.5.0 to work? Change your runtime.txt file to contain python-3.6.2 (or try another version, such as python-3.5.2, and maybe it will work. Who knows, it's not supported) and the app should be accepted by Heroku (as long as there are not other, non-related problems).
Best answer i was found to remove this error is:-
uninstall the pkg-resources==0.0.0 by pip uninstall pkg-resources==0.0.0 commmand
and run
pip freeze > requirements.txt command
and then
git add .
git commit -m "deleted the pkg from requirements.txt"
git push heroku master
enjoy the day with heroku....
pipenv lock
git add.
git commit -am "make it better"
git push heroku master
If you need a different version edit the new file and enter which version you want.
Like this:
[requires]
python_version = "2.7"
or
[requires]
python_full_version = "2.7.15"
Related
I'm currently having errors when deploying my Streamlit App to Heroku. I have done the necessary steps including the requirements.txt, setup.sh file but still having errors. What do I do?
This is the error:
(my_env) PS C:\Users\admin> heroku login
heroku: Press any key to open up the browser to login or q to exit:
Opening browser to https://cli-auth.heroku.com/auth/cli/browser/73a0eaad-0c35-474f-93dc-0c3cc2327186?requestor=SFMyNTY.g2gDbQAAAA4xNTIuMzIuMTA3LjIyN24GALr4ISB3AWIAAVGA.H95J-eKqdgobd7jDXEq_zqagK-kkddyNjZKvHi5K_wA
Logging in... done
Logged in as zipporah.luna#gmail.com
(my_env) PS C:\Users\admin> cd Documents\Eskwelabs\01112020\01152020 (my_env) PS C:\Users\admin\Documents\Eskwelabs\01112020\01152020> heroku create Creating app... done, ⬢ guarded-basin-48702
https://guarded-basin-48702.herokuapp.com/ | https://git.heroku.com/guarded-basin-48702.git
(my_env) PS C:\Users\admin\Documents\Eskwelabs\01112020\01152020> git add . (my_env) PS C:\Users\admin\Documents\Eskwelabs\01112020\01152020> git commit -m "Enter your message here" On branch master
nothing to commit, working tree clean
(my_env) PS C:\Users\admin\Documents\Eskwelabs\01112020\01152020> git push heroku master Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 310 bytes | 310.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Cairo app detected
remote: -----> Vendoring binaries
remote: Fetching https://s3.amazonaws.com/mojodna-heroku/heroku-20/cairo-1.14.6-1.tar.gz
remote:
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: ! Push rejected, failed to compile Cairo app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 76a6a1fdca290cedbf2397e2bed1db0a1680be7e
remote: !
remote: ! We have detected that you have triggered a build from source code with version 76a6a1fdca290cedbf2397e2bed1db0a1680be7e
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to agile-beach-04592.
remote:
To https://git.heroku.com/agile-beach-04592.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/agile-beach-04592.git'
(my_env) PS C:\Users\admin\Documents\Eskwelabs\01112020\01152020>
Easy Fix:
Try to upload your code to GitHub
Login to your Heroku Account
Create a new app
Connect your GitHub App
Select the repo and the branch (assuming you don't have multiple branches it would be main)
Choose Manual Deploy(Unless you have a CI)
Within a couple of minutes it should be deployed
Hosting directly by pushing from your local system
The steps are:
heroku login
git init
heroku git:remote -a your-project-name-on-heroku
git add.
git commit -m "Anything relevant"
git push heroku master
From your code block above I can infer that you missed out on setting the remote to your project on Heroku and committing your changes
I believe if you do these, then it should work fine.
I am working through the learning log project in Python Crash Course by Eric Matthes, specifically working on the learning log app. I am trying to deploy to heroku but get this error:
(ll_env) C:\Users\benpg\Documents\Coding\Python\learning_log>git push heroku master
Enumerating objects: 54, done.
Counting objects: 100% (54/54), done.
Delta compression using up to 4 threads
Compressing objects: 100% (46/46), done.
Writing objects: 100% (54/54), 16.54 KiB | 940.00 KiB/s, done.
Total 54 (delta 4), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! Python has released a security update! Please consider upgrading to python-3.7.3
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.7.4
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to pacific-refuge-12657.
remote:
To https://git.heroku.com/pacific-refuge-12657.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pacific-refuge-12657.git'
Tried everything here including the two other questions linked at the start, no luck.
Here's my requirements.txt:
Django==1.8.4
dj-database-url==0.3.0
dj-static==0.0.6
django-bootstrap3==6.2.2
gunicorn==19.3.0
static3==0.6.1
psycopg2>=2.6.1
Edit:
I am using django 2.2.4. My requirements.txt is the way it is because there is a note in the book saying 'if you're using Windows, make sure your version of requirements.txt matches the list shown here regardless of which packages you were able to install'. Why is this?
This is the first requirements.txt I had, autogenerated except for the last line. This one didn't work either, same error message:
dj-database-url==0.5.0
dj-static==0.0.6
Django==2.2.4
django-bootstrap3==11.1.0
gunicorn==19.9.0
pytz==2019.2
sqlparse==0.3.0
static3==0.7.0
psycopg2>=2.6.1
Just had the same issue, changing the Python version back do 3.7.3 fixed it. Was able to build python and execute.
django (2.0)
I am trying to upload my django app to heroku but i couldn't because it
says requested runtime(python 3.7.2) is not available.
Counting objects: 100% (1725/1725), done.
Delta compression using up to 4 threads
Compressing objects: 100% (1721/1721), done.
Writing objects: 100% (1725/1725), 9.34 MiB | 21.00 KiB/s, done.
Total 1725 (delta 93), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! Requested runtime (Python 3.7.2) is not available for this stack (heroku-18).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to mubashartech.
remote:
To https://git.heroku.com/mubashartech.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/mubashartech.git'
The Heroku Docs show that the currently supported version of Python 3.7.X is 3.7.3.
Change the value in your runtime.txt file to python-3.7.3 to use Python 3.7.3.
in the current herouku stack -20 , even 3.7.3 is not supported. check this link
Hence please use 3.7.10 in the runtime.txt file
Refer to the supported python versions and align your runtime.txt file make sure it as follows python-3.7.3 with no spacing, if your project is using an extremely lower version of python, you need to align to make sure you aren't using libraries that are not supported as per python-3.7X
I have followed the instructions given under a tutorial (Link here). I have even included the runtime.txt file with the proper version of Python. I have searched everywhere but no solution seems to work. My GitHub project link for reference:
https://github.com/MithilRocks/chakri
The error message:
PS C:\Users\Mithil Bhoras\Documents\GitHub\chakri\chakri> git push heroku master
Counting objects: 90, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (80/80), done.
Writing objects: 100% (90/90), 8.78 MiB | 234.00 KiB/s, done.
Total 90 (delta 26), reused 0 (delta 0)
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 chakrilevels.
remote:
To https://git.heroku.com/chakrilevels.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/chakrilevels.git'
For future readers, the same solution as #hansTheFranz's comment, but from the command line:
At app creation: heroku create --buildpack heroku/python app_name
For an existing app: heroku buildpacks:set heroku/python
Also, the official Heroku Buildpack: Python documentation could help.
you can write requirements.txt by small litter to "r" not Requirements.txt
if you do not have requirements.txt file
you should make this file
in "cmd" can write this line
freeze > requirements.txt
I've created an interactive bokeh plot that I'm trying to serve with Heroku. I went through the "Getting Started on Heroku with Python" tutorial, and am also following this example. With appropriate Procfile settings, I can run the Heroku app locally just fine. I've specified the Python version in both runtime.txt AND Pipfile as 2.7.14, and that's my local version as well. But when I try to push to the Heroku server, I get the following error message
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.4 (you are using # runtime.txt
remote: python-2.7.14, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.4).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing # runtime.txt
remote: python-2.7.14
remote: ! Requested runtime (# runtime.txt
remote: python-2.7.14) is not available for this stack (heroku-16).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected
The Heroku docs (at the very link given in the error message!) say that Python 2.7.14 is in fact supported. Is there something I'm missing here, like somewhere else I need to specify the python version?
My full code is here for reference.
Edit: I wrote Procfile when I meant Pipfile.
Your are supposed to specifiy python version in Pipfile. From their site
You can specify the runtime python-2.7.14, if you wish, with a Pipfile
$ cat Pipfile
[requires]
python_full_version = "2.7.14"
Thanks to some help on Twitter, I've found the answer. I didn't need to define the python version in both Pipfile AND runtime.txt. I had tried to just have runtime.txt and got the same result, but having just the Pipfile definition let me push to Heroku and the build was successful.