I'm new to heroku, but I've been following the documentation to the letter. I am deploying my dash app to heroku. The setup was going well until the final master push
> (venv) -MacBook-Air-3 heroku % git push heroku master
Enumerating objects: 12155, done.
Counting objects: 100% (12155/12155), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2900/2900), done.
Writing objects: 100% (12155/12155), 15.08 MiB | 1.53 MiB/s, done.
Total 12155 (delta 9145), reused 12155 (delta 9145)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
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: ERROR: Could not find a version that satisfies the requirement hBrotli==1.0.9
(from -r /tmp/build_77052133/requirements.txt (line 1)) (from versions: none)
remote: ERROR: No matching distribution found for hBrotli==1.0.9 (from -r /tmp/build_77052133/requirements.txt (line 1))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
I went to the requirements.txt that I created with pip3 freeze >requirements.txt as per the documentation and indeed on line 1 there was hBrotli== 1.0.9. I am not familiar with hBrotli and don't use it for my code and can't seem to find any information about it. I'm not sure what the error message is implying.
there is no package named hBrotli it may be due to some typo just change hBrotli to Brotli
This is the package that you are looking for https://pypi.org/project/Brotli/ so just change the hBrotli to Brotli
Or just do pip install Brotli
Also if needed change imports into from brotli import nameOfClass
Related
When I enter
$ git push heroku master
It Shows:
ERROR: Double requirement given: telegram (from -r /tmp/build_996aa7e0/requirements.txt (line 60)) (already in telegram==0.0.1 (from -r /tmp/build_996aa7e0/requirements.txt (line 47)), name='telegram')
There is the All logs:
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (8/8), 7.00 KiB | 716.00 KiB/s, done.
Total 8 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/python
remote: -----> Python app detected
remote: -----> Installing python-3.6.13
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: Double requirement given: telegram (from -r /tmp/build_996aa7e0/requirements.txt (line 60)) (already in telegram==0.0.1 (from -r /tmp/build_996aa7e0/requirements.txt (line 47)), name='telegram')
remote: ! Push rejected, failed to compile Python app.
remote: ! Push failed
remote: ! ## Warning - The same version of this code has already been built: 084ac888b168cf47da1ece8fd2b17b05e1d4df48
remote: ! We have detected that you have triggered a build from source code with version 084ac888b168cf47da1ece8fd2b17b05e1d4df48
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: ! If you are developing on a branch and deploying via git you must run:
remote: ! git push heroku :main
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote: Verifying deploy...
remote: ! Push rejected to zsk766.
remote: To https://git.heroku.com/zsk766.git
It looks like you've got telegram twice in your requirements.txt, once at line 60 and once at line 47.
Open requirements.txt, delete one of those lines, and repush your files.
I deployed my django app to heroku and its working well. When I change something in project on local files and want to push to heroku It always push all files and it takes time.
> git add templates/post/detail.html
> git commit -am "read more"
[master 153e38f] read more
2 files changed, 3 insertions(+), 3 deletions(-)
> git push heroku master
I use these commands. But it's deploying everything:
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 8 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 695 bytes | 695.00 KiB/s, done.
Total 7 (delta 5), 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: -----> No change in requirements detected, installing from cache
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: -----> $ python manage.py collectstatic --noinput
remote: 1392 static files copied to '/tmp/build_57ea00eb/staticfiles', 3734 post-processed.
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 280.5M
remote: -----> Launching...
remote: Released v15
remote: https://xxxxxxxxxx.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/xxxxxxxxxxxxxx.git
2d9ba8e..153e38f master -> master
The file that I changed around 1mb but it pushes 280mb. So what's the problem with it?
If you don't want to push your static file for every time then run this command :
heroku config:set DISABLE_COLLECTSTATIC=1
Enable static file for future:
heroku config:unset DISABLE_COLLECTSTATIC(for future use).
I am having this issue with heroku.
i am trying to push my application to heroku but
it seems that heroku can not install pywin32=227 but i do not know why is this happening.
i hope that someone can help me whit this issue.
Requirements.txt:
appdirs==1.4.3
asgiref==3.2.3
awsebcli==3.17.1
botocore==1.14.17
cement==2.8.2
certifi==2019.11.28
chardet==3.0.4
colorama==0.3.9
distlib==0.3.0
dj-database-url==0.5.0
Django==2.1.15
django-pyodbc-azure==2.1.0.0
docutils==0.15.2
filelock==3.0.12
future==0.16.0
gunicorn==20.0.4
idna==2.7
importlib-metadata==1.5.0
jmespath==0.9.5
pathspec==0.5.9
Pillow==7.0.0
psycopg2==2.8.4
pyodbc==4.0.30
pypiwin32==223
python-dateutil==2.8.0
python-decouple==3.3
pytz==2019.3
pywin32==227
PyYAML==5.2
requests==2.20.1
semantic-version==2.5.0
six==1.11.0
sqlparse==0.3.1
stripe==2.43.0
termcolor==1.1.0
urllib3==1.24.3
virtualenv==20.0.7
wcwidth==0.1.8
whitenoise==5.0.1
zipp==3.1.0
I'm developing on Windows 10 Professional, and the application works fine there:
C:\Users\GuGarza\test>git push heroku master
Enumerating objects: 363, done.
Counting objects: 100% (363/363), done.
Delta compression using up to 4 threads
Compressing objects: 100% (348/348), done.
Writing objects: 100% (363/363), 257.21 KiB | 1.42 MiB/s, done.
Total 363 (delta 107), reused 0 (delta 0)
remote: Downloading pytz-2019.3-py2.py3-none-any.whl (509 kB)
remote: ERROR: Could not find a version that satisfies the requirement pywin32==227 (from -r
/tmp/build_000de559e8272ea11b28b5ee568bf649/requirements.txt (line 28)) (from versions: none)
remote: ERROR: No matching distribution found for pywin32==227 (from -r
/tmp/build_000de559e8272ea11b28b5ee568bf649/requirements.txt (line 28))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to memotion.
remote:
To https://git.heroku.com/memotion.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/memotion.git'
I got the same error while deploying flask app in azure app server.
Removing/commentting out pywin32==227 in requirements.txt worked for me.
Conditional dependencies is a better choice in this situation. This way you don't break things on Windows.
Add ;platform_system == "Windows" right after the Windows-only packages
I had the same problem in Pycharm.
Installing new version or packages like pypiwin32 did not work as described above.
Removing packages from the req file did not work either.
I copied my dev files, then I deleted the project.
I set up a completely new project and copied the Py files into it.
It worked.
The cause for the error message above was:
I did corrupt my project by trying to install chart_studio with pip, which did not work. It only works with Conda.
This corrupted my req and my site packages.
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.
I am trying to deploy my a django app to heroku. I have a virtual environment(of course). I have the procfile, setup.py and runtime.txt set up correctly. It runs perfectly on a local development server, but when I push to heroku it gives some kind of error with the requirements file.
This is the third traceback after pushing to heroku. I changed the procfile the first two times and then it only gave errors with the procfile. Now that the procfile errors are gone I have some kind of error with this.
Traceback:
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 309 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Using set buildpack heroku/python
remote: -----> Python app detected
remote: -----> Uninstalling stale dependencies
remote: Invalid requirement: 'There was a problem loading the given requirements files.'
remote: Traceback (most recent call last):
remote: File "/app/.heroku/python/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/req/req_install.py", line 77, in
__init__
remote: req = pkg_resources.Requirement.parse(req)
remote: File "/app/.heroku/python/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/_vendor/pkg_resources/__init__.p
y", line 3036, in parse
remote: req, = parse_requirements(s)
remote: File "/app/.heroku/python/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/_vendor/pkg_resources/__init__.p
y", line 2980, in parse_requirements
remote: "version spec")
remote: File "/app/.heroku/python/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/_vendor/pkg_resources/__init__.p
y", line 2945, in scan_list
remote: raise RequirementParseError(msg, line, "at", line[p:])
remote: pip._vendor.pkg_resources.RequirementParseError: Expected version spec in There was a problem loading the given
requirements files. at was a problem loading the given requirements files.
remote:
remote: You are using pip version 8.1.1, however version 8.1.2 is available.
remote: You should consider upgrading via the 'pip install --upgrade pip' command.
remote: $ pip install -r requirements.txt
remote:
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web, worker
remote:
remote: -----> Compressing...
remote: Done: 60.3M
remote: -----> Launching...
remote: Released v6
remote: https://calm-caverns-85777.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/calm-caverns-85777.git
b1b06b0..d6b1a95 master -> master
Procfile:
web: gunicorn blog.wsgi
worker: python worker.py
requirements.txt:
dj-database-url==0.4.1
Django==1.9.7
django-crispy-forms==1.6.0
django-markdown-deux==1.0.5
django-pagedown==0.1.1
gunicorn==19.6.0
markdown2==2.3.1
Pillow==3.2.0
whitenoise==3.2
runtime.txt:
python-3.5.1
I can install the dependancies locally from the requirements.txt file and the other thing is when I try to update pip it says it is already up to date. My runtime environment is set to python 3.5.1. The app crashes when it is deployed and I am assuming it is because of the traceback errors. What can I do to fix this?
How was the requirements.txt file created? Is it possible it is corrupted or not plain text or has non-printable characters in it?
I recommend deleting requirements.txt and generating it cleanly based on pip freeze.
If you are using Windows Powershell the encoding issue could be affecting you. The suggested solution is:
pip freeze | Out-File -Encoding ASCII requirements.txt