Heroku push can't find Django 3.2.8 - python

When pushing my git repository to heroku it fails and gives this error:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/python
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the same version as the last build: python-3.9.7
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Requirements file has been changed, clearing cached dependencies
remote: -----> Installing python-3.9.7
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting Gunicorn==20.1.0
remote: Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
remote: Collecting Jinja2==2.11.2
remote: Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
remote: Collecting Django-Heroku==0.3.1
remote: Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
remote: ERROR: Could not find a version that satisfies the requirement Django-3.2.8 (from -r /tmp/build_43fa9180/requirements.txt (line 4)) (from versions: none)
remote: ERROR: No matching distribution found for Django-3.2.8 (from -r /tmp/build_43fa9180/requirements.txt (line 4))
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: 262a4549043aa448dc2000c886cad672f979d8f0
remote: !
remote: ! We have detected that you have triggered a build from source code with version 262a4549043aa448dc2000c886cad672f979d8f0
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 shrouded-bastion-04661.
remote:
To https://git.heroku.com/shrouded-bastion-04661.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/shrouded-bastion-04661.git'
It is using python 3.9.7 which is compatible with django 3.2.8. The weird part is that everything built fine until I followed this tutorial on using Azure to host static files https://medium.com/#DawlysD/django-using-azure-blob-storage-to-handle-static-media-assets-from-scratch-90cbbc7d56be
Since then I've had to install PostgreSQL and Visual Studio just to get a pg_config file to work.
Edit:
Here is the requirements.txt:
Gunicorn==20.1.0
Jinja2==2.11.2
Django-Heroku==0.3.1
Django-3.2.8
asgiref-3.4.1
azure-core-1.19.0
azure-storage-blob-12.9.0
certifi-2021.10.8
cffi-1.15.0
charset-normalizer-2.0.7
cryptography-35.0.0
django-storages-1.12.2
idna-3.3
isodate-0.6.0
msrest-0.6.21
oauthlib-3.1.1
pycparser-2.20
pytz-2021.3
requests-2.26.0
requests-oauthlib-1.3.0
six-1.16.0
sqlparse-0.4.2
urllib3-1.26.7

- is invalid in version specifiers.
All of your dependencies in the format package-version need to be changed to package==version.
For example, change
Django-3.2.8
to
Django==3.2.8
and
azure-storage-blob-12.9.0
to
azure-storage-blob==12.9.0

Related

ERROR: Invalid requirement: 'asgiref 3.5.2'

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

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/tmp/build/80754af9/asgiref_1594338739818/work'

While deploying my website on heroku. I also updated my requirements.txt file still there is this issue.
git push heroku master
Enumerating objects: 98, done.
Counting objects: 100% (98/98), done.
Delta compression using up to 4 threads
Compressing objects: 100% (87/87), done.
Writing objects: 100% (98/98), 1.31 MiB | 29.00 KiB/s, done.
Total 98 (delta 35), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.12
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting alabaster==0.7.12
remote: Downloading alabaster-0.7.12-py2.py3-none-any.whl (14 kB)
remote: Collecting appdirs==1.4.4
remote: Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
remote: Collecting argh==0.26.2
remote: Downloading argh-0.26.2-py2.py3-none-any.whl (30 kB)
remote: Processing /tmp/build/80754af9/asgiref_1594338739818/work
remote: ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/tmp/build/80754af9/asgiref_1594338739818/work'
remote:
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: 9782a444fca0b0d09e0566b33ecbffce4eb90d89
remote: !
remote: ! We have detected that you have triggered a build from source code with version 9782a444fca0b0d09e0566b33ecbffce4eb90d89
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 blogshome.
remote:
To https://git.heroku.com/blogshome.git
! [remote rejected] master -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/blogshome.git'
The requirements.txt file contains colorama==0.4.3
Django==2.2.5 django-appconf==1.0.4 django-crispy-forms==1.9.1 django-multiselectfield==0.1.12 django-phone-field==1.8.1 django-phonenumber-field==4.0.0 django-select2==7.4.2 django-xhtml2pdf==0.0.4 graphviz==0.13.2 gunicorn==20.0.4 html5lib==1.1 idna==2.9 isort==4.3.21 lazy-object-proxy==1.4.3 mccabe==0.6.1 phonenumbers==8.12.5 Pillow==7.2.0 pylint==2.5.3 PyPDF2==1.26.0 pytz==2019.3 reportlab==3.5.48 requests==2.23.0 six==1.15.0 soupsieve==2.0.1 sqlparse==0.3.1 toml==0.10.1 urllib3==1.25.9 virtualenv==16.7.9 webencodings==0.5.1 wrapt==1.12.1 xhtml2pdf==0.2.4
Can somebody help and provide me an solution. Thankyou in advance
I just deleted the .git folder from my project directory and then used
git init to create a new one.
.git folder is actually hidden in the main directory so, first unhide and then delete it.
Also use pip freeze to get all requirements.

Trying to push to Heroku -- Why am I getting this? ERROR: Could not find a version that satisfies the requirement python-3.8.6

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'

Django Web App Heroku Deployement : No matching distribution found for decouple==0.0.7

I am deploying a web app made in Django on Heroku.
I am following a tutorial in which tutor has made a w/s without any CSS / Image input from User. But my app has lot of style and profile pics etc which need ImageField in model.
IMP -> I made the project for Django 2.2, but django 3 got launched so I am using that.
Please help me...
I have done following steps:
Installed Anaconda
Made Virtual Env & Activated it.
Installed pip
Installed Dependencies
pip freeze > requirements.txt
git add . & git push -am "Text"
git push heroku master
My requirements.txt :
asgiref==3.2.3
certifi==2019.11.28
cffi==1.13.2
decouple==0.0.7
dj-database-url==0.5.0
Django==3.0.2
django-appconf==1.0.3
django-bootstrap3==12.0.3
django-heroku==0.3.1
django-mediumeditor==1.0.0
gunicorn==20.0.4
misaka==2.1.1
psycopg2==2.8.4
pycparser==2.19
python-decouple==3.3
pytz==2019.3
six==1.14.0
sqlparse==0.3.0
whitenoise==5.0.1
My Error:
Enumerating objects: 18, done.
Counting objects: 100% (18/18), done.
Delta compression using up to 8 threads
Compressing objects: 100% (16/16), done.
Writing objects: 100% (16/16), 1.96 KiB | 1.96 MiB/s, done.
Total 16 (delta 9), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Need to update SQLite3, clearing cache
remote: -----> Installing python-3.6.10
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote: Collecting asgiref==3.2.3 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 1))
remote: Downloading https://files.pythonhosted.org/packages/a5/cb/5a235b605a9753ebcb2730c75e610fb51c8cab3f01230080a8229fa36adb/asgiref-3.2.3-py2.py3-none-any.whl
remote: Collecting certifi==2019.11.28 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 2))
remote: Downloading https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl (156kB)
remote: Collecting cffi==1.13.2 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 3))
remote: Downloading https://files.pythonhosted.org/packages/49/72/0d42f94fe94afa8030350c26e9d787219f3f008ec9bf6b86c66532b29236/cffi-1.13.2-cp36-cp36m-manylinux1_x86_64.whl (397kB)
remote: Collecting decouple==0.0.7 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 4))
remote: Could not find a version that satisfies the requirement decouple==0.0.7 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 4)) (from versions: )
remote: No matching distribution found for decouple==0.0.7 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 4))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to *******.
remote:
To https://git.heroku.com/******.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/******.git'
You will want to add a runtime.txt file at the root of your project with content:
python-3.7.2
And then push again.
You use Python 3.6, decouple requires Python 3.7+.

Could not find a version that satisfies the requirement anaconda-client==1.6.14 error when deploying to Heroku

I get this error when I try and deploy a flask application to Heroku. I can't find a solution that works. I have tried uninstalling and reinstalling all packages with pip. Love some help thanks!
Beths-iMac:user-feedback-app bethwalsh$ git push heroku master
Counting objects: 56, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (50/50), done.
Writing objects: 100% (56/56), 3.71 MiB | 1.11 MiB/s, done.
Total 56 (delta 6), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.7
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting alabaster==0.7.10 (from -r /tmp/build_6a5b669a64188c02d949bbd0ed931860/requirements.txt (line 1))
remote: Downloading https://files.pythonhosted.org/packages/2e/c3/9b7dcd8548cf2c00531763ba154e524af575e8f36701bacfe5bcadc67440/alabaster-0.7.10-py2.py3-none-any.whl
remote: Collecting anaconda-client==1.6.14 (from -r /tmp/build_6a5b669a64188c02d949bbd0ed931860/requirements.txt (line 2))
remote: Could not find a version that satisfies the requirement anaconda-client==1.6.14 (from -r /tmp/build_6a5b669a64188c02d949bbd0ed931860/requirements.txt (line 2)) (from versions: 1.1.1, 1.2.2)
remote: No matching distribution found for anaconda-client==1.6.14 (from -r /tmp/build_6a5b669a64188c02d949bbd0ed931860/requirements.txt (line 2))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to user-feedback-app.
remote:
To https://git.heroku.com/user-feedback-app.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/user-feedback-app.git'

Categories

Resources