I have an issue publishing my python code to heroku
keep in mind that this is my first project on heroku and first with anything to do with repositories
Counting objects: 18, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (18/18), 21.80 KiB | 0 bytes/s, done.
Total 18 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using python-3.6, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6
remote: ! Requested runtime (python-3.6) 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 project.
remote:
To https://git.heroku.com/project.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/project.git'
Try this
pipenv lock
git add.
git commit -am "make it better"
git push heroku master
If you want a different version, edit the new file and enter the information in:
[requires]
python_version = "2.7" or [requires] python_full_version = "2.7.15"
your requirements.txt file must contain python-3.6.5 everything in small letters and - sign is important
Related
When I try to type "git push heroku master" in the console, I have the following problem. This is my second approach to heroku and again I have a problem in the same place, I was looking for advice on the Internet, but nothing helps me
(venv) C:\Users\patryk\Desktop\Django\MyPage>git push heroku master
Enumerating objects: 33, done.
Counting objects: 100% (33/33), done.
Delta compression using up to 4 threads
Compressing objects: 100% (27/27), done.
Writing objects: 100% (33/33), 17.14 KiB | 1.90 MiB/s, done.
Total 33 (delta 2), 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 xxx.
remote:
To https://git.heroku.com/xxx.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/xxx.git'
requirements.txt file:
-r requirements-dev.txt
gunicorn
psycopg2
requirements-dev.txt file:
dj-database-url==0.5.0
dj-static==0.0.6
Django==2.2.4
django-bootstrap-form==3.4
djangorestframework==3.10.2
Pillow==6.1.0
python-decouple==3.1
pytz==2019.2
sqlparse==0.3.0
static3==0.7.0
I am trying to use $ git push heroku master but I get this error:
$ git push heroku master
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 534 bytes | 534.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using , which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing
remote: ! Requested runtime () 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 securibot.
remote:
To https://git.heroku.com/securibot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/securibot.git'
My runtime.txt file reads the following:
python-3.6.5
Any idea why I'm getting this error?
Did you read the referenced URL that was posted?
If you look through https://devcenter.heroku.com/articles/python-runtimes, you will see that "Newly created Python applications default to the Python 3.6.4 runtime".
You can specify your own run time in either your Pipfile or creating a runtime.txt with the following:
python-3.6.5
I updated the python version from 3.6.4 to 3.6.5 today. This is because, in the process of distributing to Heroku, it recommends version 3.6.5. Therefore, the following power shell contents were confirmed.
Writing objects: 100% (35/35), 11.68 KiB | 0 bytes/s, done.
Total 35 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using ÿþpython-3.6.5, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing ÿþpython-3.6.5
remote: ! Requested runtime (ÿþpython-3.6.5) 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:
remote: ! Push rejected to XXXXXXXX.
remote:
To https://git.heroku.com/XXXXXXXX.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXXXXXXX.git
After changing my runtime.txt file to UTF-8, I now get the following error:
Writing objects: 100% (35/35), 11.68 KiB | 0 bytes/s, done.
Total 35 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using python-3.6.5, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6.5
remote: ! Requested runtime (python-3.6.5) 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 XXXXXXXX.
remote:
To https://git.heroku.com/XXXXXXXX.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXXXXXXX.git
Why is python-3.6.5 being rejected? Isn't that exactly what Heroku says is the default version?
Heroku believes that your runtime.txt contains some extra characters:
ÿþpython-3.6.5
This is probably byte-order mark for a file encoded as UTF-16 in little-endian order. Make sure you're using a sane encoding for that file (and others). UTF-8 is a good choice in virtually all situations.
You're trying to install ÿþpython-3.6.5 not python-3.6.5 as the console output suggests. Remove ÿþ and it should work as expected.
I am new to heroku as well as python (Django). i have made an app in django and want to push on heroku. but on git push heroku master it giving me this error.
Writing objects: 100% (245/245), 10.37 MiB | 110.00 KiB/s, done.
Total 245 (delta 35), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing Python-2.7.13
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: /app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda
all: line 5: /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 djangoshopnror.
remote:
To https://git.heroku.com/djangoshopnror.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
'https://git.heroku.com/djangoshopnror.git'
i have requirements.txt file and runtime.txt file.
runtime.txt look like this
Python-2.7.13
and requirements.txt look like this
BestBuyAPI==0.0.51
dj-database-url==0.4.2
Django==1.9
django-cors-headers==2.0.2
djangorestframework==3.6.2
djangorestframework-jwt==1.10.0
ebaysdk==2.1.4
gunicorn==19.7.1
lxml==3.7.3
psycopg2==2.7.1
PyJWT==1.5.0
pytz==2017.2
requests==2.7.0
virtualenv==15.1.0
wapy==1.0.0
whitenoise==3.3.0
one weired thing is when i change runtime.txt with python version 3.5.x it works. but due to some reasons i have to use python 2.7.x .
can anyone have answer about this. any suggestion or help will be highly appriciated.
I am trying to push an django web app to heroku for the first time, and there are some error message as following.
Delta compression using up to 4 threads.
Compressing objects: 100% (68/68), done.
Writing objects: 100% (81/81), 105.31 KiB | 0 bytes/s, done.
Total 81 (delta 7), 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
(cedar-14).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/pytho
n-support
remote:
remote: ! Push rejected, failed to compile Python app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to polar-lake-12528.
remote:
To https://git.heroku.com/polar-lake-12528.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/polar-lake-12528.git'
My runtime.txt looks like:
python-3.5.1
I have already changed to lowercase and update the version of python to 3.5.1, but still not working.
Python 3.5.0 is not supported. You can change it to python-3.5.1.
See https://devcenter.heroku.com/articles/python-runtimes#supported-python-runtimes for supported runtimes.