I am new to heroku and I wanted to deploy a simple app, when i push to heroku it is given me the error below. I check online unfortunately I dont find the right answer to it.
ERROR GIVEN
Enumerating objects: 73, done.
Counting objects: 100% (73/73), done.
Delta compression using up to 4 threads
Compressing objects: 100% (71/71), done.
Writing objects: 100% (73/73), 24.58 KiB | 719.00 KiB/s, done.
Total 73 (delta 11), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the buildpack default: python-3.10.4
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.10.4
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: ERROR: Invalid requirement: 'asgiref 3.5.2' (from line 1 of /tmp/build_44a6c2b3/requirements.txt)
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to olakaymytodo.
remote:
To https://git.heroku.com/olakaymytodo.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/olakaymytodo.git'
I don't know waht have done wrong that make that show up my requirements.txt file is as follow
requirements.txt file
asgiref 3.5.2
Django 4.0.4
django-environ 0.8.1
environ 1.0
gunicorn 20.1.0
Pillow 9.1.1
pip 22.0.4
psycopg2 2.9.3
setuptools 62.1.0
sqlparse 0.4.2
tzdata 2022.1
wheel 0.37.1
is it the asgiref version?
I have search online but dont get a right answer to it. I hope someone here can help.
requirement.txt should be like this,
Try it,
asgiref==3.5.2
Django==4.0.4
django-environ==0.8.1
environ==1.0
gunicorn==20.1.0
Pillow==9.1.1
pip==22.0.4
psycopg2==2.9.3
setuptools==62.1.0
sqlparse==0.4.2
tzdata==2022.1
wheel==0.37.1
Related
I am trying to deploy my first project on Heroku and having an issue trying to install Exiftools on Heroku. My site is highly dependent on using ExifField within my models to get image information from pictures which is then displayed within my Django Admin to be edited etc. This all works fine locally in development.
Exiffield relies on Exiftool.exe to work, so I have to install a buildpack to Heroku which I have done, but it fails to see it during release when pushing to Heroku via CLI. All Django modules have installed OK.
I have added Procfile , requirements, runtime and everything seems to go OK, it even states it's intalled Exiftool but fails on release. Log below. Any help would be greatly appreciated.
I was thinking it was issue with Procfile but it seems correct.
release: python manage.py migrate
web: gunicorn blog.wsgi
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 375 bytes | 375.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote: 1. heroku/python
remote: 2. https://github.com/benalavi/buildpack-exiftool
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote: ! Python has released a security update! Please consider upgrading to python-3.9.10
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> No change in requirements detected, installing from cache
remote: -----> Using cached install of python-3.9.0
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: -----> Skipping Django collectstatic since the env var DISABLE_COLLECTSTATIC is set.
remote: -----> exiftool app detected
remote: -----> Installing exiftool-9.40
remote: Setting PATH
remote: -----> Discovering process types
remote: Procfile declares types -> release, web
remote:
remote: -----> Compressing...
remote: Done: 80.4M
remote: -----> Launching...
remote: ! Release command declared: this new release will not be available until the command succeeds.
remote: Released v37
remote: https://********.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
remote: Running release command...
remote:
remote: SystemCheckError: System check identified some issues:
remote:
remote: ERRORS:
remote: myblog.Photo.exif: (exiffield.E001) `exiftool` not found.
remote: HINT: Please install `exiftool.`
remote: Waiting for release... failed.
To https://git.heroku.com/******.git
7281f6e..bf1bc47 master -> master
I have created virtual env with anaconda prompt and created my django project in that env. I have created repository on github and push my code there and also create app on heroku but when i am running this git push heroku main command, it showing me an error which I have given below:
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/tmp/build/80754af9/asgiref_1605055780383/work'..
traceback:
PS C:\Users\AHMED\newrest\source> git push heroku main
Enumerating objects: 48, done.
Counting objects: 100% (48/48), done.
Delta compression using up to 4 threads
Compressing objects: 100% (44/44), done.
Writing objects: 100% (48/48), 16.22 KiB | 615.00 KiB/s, done.
Total 48 (delta 10), 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.8.6
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.8.5
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Processing /tmp/build/80754af9/asgiref_1605055780383/work
remote: ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/tmp/build/80754af9/asgiref_1605055780383/work'
remote:
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to restlearnsignup.
remote:
To https://git.heroku.com/restlearnsignup.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/restlearnsignup.git'
requirement file
asgiref # file:///tmp/build/80754af9/asgiref_1605055780383/work
astroid==2.4.1
certifi==2020.12.5
cffi==1.14.4
chardet==3.0.4
click==7.1.2
colorama==0.4.3
cryptography==3.3.1
decorator==4.4.2
Django==3.0.3
django-rest-knox==4.1.0
djangorestframework==3.12.2
dodgy==0.2.1
dynaconf==3.1.2
flake8==3.8.3
flake8-polyfill==1.0.2
gender-guesser==0.4.0
gunicorn==20.0.4
hvac==0.10.5
idna==2.10
isort==4.3.21
knox==0.1.11
lazy-object-proxy==1.4.3
loguru==0.5.3
mccabe==0.6.1
pep8-naming==0.10.0
prospector==1.3.0
pycodestyle==2.6.0
pycparser==2.20
pydocstyle==5.0.2
pyflakes==2.2.0
pylint==2.5.2
pylint-celery==0.3
pylint-django==2.0.15
pylint-flask==0.6
pylint-plugin-utils==0.6
pytz # file:///tmp/build/80754af9/pytz_1606604771399/work
PyYAML==5.3.1
requests==2.25.0
requirements-detector==0.7
setoptconf==0.2.0
shortuuid==1.0.1
six==1.15.0
snowballstemmer==2.0.0
sqlparse # file:///tmp/build/80754af9/sqlparse_1602184451250/work
toml==0.10.1
tqdm # file:///tmp/build/80754af9/tqdm_1607369919789/work
urllib3==1.26.2
validators==0.18.1
whitenoise==5.2.0
win32-setctime==1.0.3
wincertstore==0.2
wrapt==1.12.1
Anyone who know how to resolve this error ?. I learning deployment and I don't know much about this. I research but couldn't found anything helpful.
Use:
$ pip list
And edit the requirements.txt file to replace the temporary file with the actual version of the packages
Edit your requirements to point to asgiref version instead of temporary file
For example
asgiref==3.3.1
Very simple python app. get this when trying to push to Heroku from git:
git push heroku main
Enumerating objects: 38, done.
Counting objects: 100% (38/38), done.
Delta compression using up to 8 threads
Compressing objects: 100% (33/33), done.
Writing objects: 100% (38/38), 21.09 KiB | 5.27 MiB/s, done.
Total 38 (delta 5), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.8.6
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: ERROR: Could not find a version that satisfies the requirement python-3.8.6 (from -r /tmp/build_006a9333/requirements.txt (line 1)) (from versions: none)
remote: ERROR: No matching distribution found for python-3.8.6 (from -r /tmp/build_006a9333/requirements.txt (line 1))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 09e26ac7b3791cd141f1df4ece7b18b6093229f8
remote: !
remote: ! We have detected that you have triggered a build from source code with version 09e26ac7b3791cd141f1df4ece7b18b6093229f8
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 :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 peaceful-basin-40727.
remote:
To https://git.heroku.com/peaceful-basin-40727.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/peaceful-basin-40727.git'
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 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.