Heroku python app failing to build when installing sqlite3 - python

My Python app on Heroku failed to build consistently:
-----> Python app detected
! Python has released a security update! Please consider upgrading to python-3.6.8
Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Found python-3.6.4, removing
-----> Installing python-3.6.7
-----> Installing pip
-----> Installing SQLite3
! Push rejected, failed to compile Python app.
! Push failed
It is a Django application that runs fine locally.
python-3.6.7 specified in runtime.txt, and I've tried other versions.
My Procfile contains:
release: python <appname>/manage.py migrate
web: python <appname>/manage.py runserver 0.0.0.0:$PORT
I could probably use gunicorn but that's irrelevant here. The build logs doesn't seem to provide me any information.
requirements.txt
chardet==3.0.4
Django==2.0.2
idna==2.6
pytz==2018.3
requests==2.18.4
urllib3==1.22
dj-database-url==0.5.0
setuptools==1.0.0

Try this in your app.json. Although it a temporary solution
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-python.git#remove-
sqlite"
},

See: https://travis-ci.org/heroku/heroku-buildpack-python
Upgrade the the stack from heroku-16 to heroku-18 in app.json.

Related

ERROR: Twisted-20.3.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform

Python 3.8.3, Scrapy 2.2.0 and Twisted-20.3.0-cp38-cp38-win_amd64.whl are installed on my computer. Everything works as expected.
I can’t install Scrapy without Twisted, so Twisted is also installed, but when I try to transfer the application to Heroku, an error appears. How do I use Scrapy on Heroku?
-----> Found python-3.6.10, removing
-----> Requirements file has been changed, clearing cached dependencies
-----> Installing python-3.8.3
-----> Installing pip
-----> Installing SQLite3
-----> Installing requirements with pip
ERROR: Twisted-20.3.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.
! Push rejected, failed to compile Python app.
! Push failed```
Remove Twisted-20.3.0-cp38-cp38-win_amd64.whl in your requirement.txt
I don't think it's required because while installing scrapy it will be taken care of

Error while deploying Flask app on Heroku "Requested runtime not available for this stack"

I'm trying to deploy an app on Heroku. I have included the runtime.txt file and included the latest python version 3.6.3 as suggested, but I'm getting the following error.
-----> Python app detected
! The latest version of Python 3 is python-3.6.3 (you are using python 3.6.3, which is unsupported).
! We recommend upgrading by specifying the latest version (python-3.6.3).
Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python 3.6.3
! Requested runtime (python 3.6.3) is not available for this stack (heroku-16).
! Aborting. More info: https://devcenter.heroku.com/articles/python-support
! Push rejected, failed to compile Python app.
! Push failed

heroku can't find pip when I push app to it

When I try to push my django app to heroku it fails right at the beginning:
remote: -----> Python app detected
remote: -----> Installing python-3.5.1
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: /app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/
bin/steps/pip-install: line 5: /app/.heroku/python/bin/pip:
No such file or directory
remote: ! Push rejected, failed to compile Python app.
remote:
I apparently do something wrong, but I did the same thing many times before. What's wrong?
I had this exact same problem yesterday and it was really frustrating as I had deployed to Django before under the exact same settings with no problem.
In your runtime.txt file change it from:
python-3.5.1
to
python-3.6.1
Why changing the Python version on Heroku matters beats me but it worked like a charm.

Heroku Python failed to detect app matching buildpack

I can't deploy my Flask app to Heroku...
I've searched in every thread I can and nothing worked for me : add a runtime.txt, set a buildpack. I don't know what can be wrong now.
Here is my root directory for the app :
Project
- .git
- Procfile
- Readme.md
- app
- config.py
- requirements.txt
- runtime.txt
- web.py
Here's the content of requirements.txt:
appdirs==1.4.3
click==6.7
Flask==0.12.1
Flask-WTF==0.14.2
itsdangerous==0.24
Jinja2==2.9.5
MarkupSafe==1.0
packaging==16.8
pyparsing==2.2.0
six==1.10.0
Werkzeug==0.12.1
WTForms==2.1
The Procfile :
web: python web.py
And the runtime.txt:
python-2.7.13
When I do git push heroku master, it prints:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to appname.
remote:
I tried to add a buildpack with heroku buildpacks:add heroku/Python but then it says that it can't detect app for python buildpack.
What could I possibly did wrong ?
Change requirements.py to requirements.txt.
If you're using the default Python 2.7.13 you shouldn't need a runtime.txt. You'd think that specifying the runtime would trigger the language detection but even without packages to install, Heroku requires an empty requirements.txt.
I was spend time with a very similar error.
In my case, i tried to deploy a django app.
I just run these commands to setup the buildpack
heroku login
heroku create --stack cedar --buildpack git://github.com/heroku/heroku-buildpack-python.git
heroku config:add BUILDPACK_URL=git#github.com:heroku/heroku-buildpack-python.git#purge
heroku config:set HEROKU=1
I decided to post this here because it took me a long time to get these tips
edit the content of your Procfile to
web: gunicorn web:app --log-file=-
I assume your web.py file is contained in your project's root folder i.e you see it once you enter your project's "Project" folder.
Otherwise, if it is contained in the app folder then use
web: gunicorn app.web:app --log-file=-
I also run into similar problem. I was able to fix it by adding the runtime.txt
just put the version of the python you are using in the runtime.txt
python-2.7.14
I'm late the to party but if you already have a requirements.txt file and you're getting this error, try adding a Procfile like shown here in the documentation:
https://devcenter.heroku.com/articles/getting-started-with-python#define-a-procfile

Heroku Pymongo fails deployment at "Preparing static assets"

I am trying to deploy a Flask-Restful app which has the following dependencies:
Flask==0.10.1
Flask-RESTful==0.2.12
Jinja2==2.7.3
MarkupSafe==0.23
Werkzeug==0.9.6
aniso8601==0.85
argparse==1.2.1
gunicorn==19.1.1
itsdangerous==0.24
pymongo==2.7.2
pytz==2014.9
six==1.8.0
wsgiref==0.1.2
When I remove the pymongo package from the file and git push heroku master everything is ok and working.
When I add it again and try to deploy the process stuck at:
Successfully installed pymongo
Cleaning up...
-----> Preparing static assets
And then it hits timeout after 15 minutes. Any ideas why it stucks there and how can I escape it?
Thanks!
heroku config: set DISABLE_COLLECTSTATIC = 1
This for the moment fixed the problem so the upload is successful. I am still waiting for the Heroku's team support, they said they are working on the problem.

Categories

Resources