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
Related
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
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
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.
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.