deploying python flask app on heroku gives error with functools32 - python

First question on stackoverflow :D (because I found almost everything until now).
I try to deploy my python app to Heroku, but the following error appears:
git push heroku master
Counting objects: 7036, done.
Compressing objects: 100% (3933/3933), done.
Writing objects: 100% (7036/7036), 10.97 MiB | 338.00 KiB/s, done.
Total 7036 (delta 2020), reused 7021 (delta 2014)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.2
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: Collecting aniso8601==1.2.1 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 1))
remote: Downloading aniso8601-1.2.1.tar.gz (62kB)
remote: Collecting click==6.7 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 2))
remote: Downloading click-6.7-py2.py3-none-any.whl (71kB)
remote: Collecting cycler==0.10.0 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 3))
remote: Downloading cycler-0.10.0-py2.py3-none-any.whl
remote: Collecting deap==1.0.2.post2 (from -r
remote: Collecting Flask==0.12.2 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 5))
remote: Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
remote: Collecting Flask-RESTful==0.3.6 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 6))
remote: Downloading Flask_RESTful-0.3.6-py2.py3-none-any.whl
remote: Collecting functools32==3.2.3.post2 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 7))
remote: Downloading functools32-3.2.3-2.zip
remote: Complete output from command python setup.py egg_info:
remote: This backport is for Python 2.7 only.
remote:
remote: ----------------------------------------
remote: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-l0v0636d/functools32/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to XXXXXXX (servername by Heroku).
remote:
On my virtual box everything works fine if I do
pip install -r requirements.txt
I tried the following with no avail:
changing functools32 version
Removing functools from requirements text, which made me realize it is a dependency by Flask for decorators :(

Answer (thanks to the comments):
I didn't realize that I used python 2.7 (again, I am a beginner) in my virtualenv. Seems that using then the functools somewhere automatically installed the functools32 package which ports the functools from python 3 to 2. Heroku is using python 3 by default, so that is why functools32 is probably not available.
I now installed a python 3 virtual environment thanks to this post, ported the few things I hat to port from 2 to 3 and everything works like a charm.
Thanks to davidism & dimmg to point me into the right direction.

Related

Heroku push can't find Django 3.2.8

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

Herokuapp fails to compile

My app has compiled before, but now when I attempt to push new changes, it gives a warning of invalid fragment for a spacy model language package:
Installing dependencies from Pipfile.lock (afd0bd)…
remote: WARNING: Invalid fragment string egg=en-core-web-sm==2.1.0
remote: ABORTING INSTALL... You will have to reinstall any packages that failed to install.
remote: You may have to manually run pipenv lock when you are finished.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to captain-hp-bot.
Here is my pipfile:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
chatterbot = {editable = true,git = "https://github.com/mmoore7/ChatterBot.git"}
en-core-web-sm = {file = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.1.0/en_core_web_sm-2.1.0.tar.gz"}
pymongo = "*"
flask = "*"
flask-wtf = "*"
flask-bcrypt = "*"
flask-login = "*"
dnspython = "*"
gunicorn = "*"
pandas = "*"
botbuilder-core = "*"
asyncio = "*"
html2text = "*"
[requires]
python_version = "3.8"
I think it has to do with the version of pipenv it's using to install the packages, which is version 2018.5.18. I had an with that exact package on an older version of pipenv (can't quite remember which version but it's a recent one), which I traced to this issue: Issue #4318. It was fixed in the latest version, which I'm now using on my machine, version 2020.6.2.
If this is the issue, how can I get it to use an update version of pipenv to complete the compilation? Or is my syntax wrong in the pipfile for that package (it's been fine that way for awhile).
I tried clearing the cache and then pushing, but I still get the same error.
Here's the whole log:
Enumerating objects: 20, done.
Counting objects: 100% (20/20), done.
Delta compression using up to 12 threads
Compressing objects: 100% (10/10), done.
Writing objects: 100% (11/11), 14.39 KiB | 1.20 MiB/s, done.
Total 11 (delta 7), 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.3
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 2018.5.18…
remote: Installing -e git+https://github.com/mmoore7/ChatterBot.git#egg=chatterbot…
remote: Obtaining chatterbot from git+https://github.com/mmoore7/ChatterBot.git#egg=chatterbot
remote: Cloning https://github.com/mmoore7/ChatterBot.git to ./src/chatterbot
remote: Collecting mathparse<0.2,>=0.1 (from chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/c3/e5/4910fb85950cb960fcf3f5aabe1c8e55f5c9201788a1c1302b570a7e1f84/mathparse-0.1.2-py3-none-any.whl
remote: Collecting nltk<4.0,>=3.2 (from chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/92/75/ce35194d8e3022203cca0d2f896dbb88689f9b3fce8e9f9cff942913519d/nltk-3.5.zip (1.4MB)
remote: Collecting pint>=0.8.1 (from chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/3f/1c/95b113bd8da60e2aeecb4988c007a867682c739c721cb3ab16de77913040/Pint-0.12-py2.py3-none-any.whl (192kB)
remote: Collecting python-dateutil<2.9,>=2.8 (from chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
remote: Collecting pyyaml<5.4,>=5.3 (from chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz (269kB)
remote: Collecting spacy<2.2,>=2.1 (from chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/1f/e2/46650d03c7ff2b57ed7af211d41c3f606540f7adea92b5af65fcf9f605c0/spacy-2.1.9.tar.gz (30.7MB)
remote: Collecting sqlalchemy<1.4,>=1.3 (from chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/05/ca/4c3ccb306fdec0e105a84c7d156e5bdd9c86a86923b05fd47877cddc62ed/SQLAlchemy-1.3.17-cp38-cp38-manylinux1_x86_64.whl (1.3MB)
remote: Collecting pytz (from chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/4f/a4/879454d49688e2fad93e59d7d4efda580b783c745fd2ec2a3adf87b0808d/pytz-2020.1-py2.py3-none-any.whl (510kB)
remote: Collecting click (from nltk<4.0,>=3.2->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl (82kB)
remote: Collecting joblib (from nltk<4.0,>=3.2->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/b8/a6/d1a816b89aa1e9e96bcb298eb1ee1854f21662ebc6d55ffa3d7b3b50122b/joblib-0.15.1-py3-none-any.whl (298kB)
remote: Collecting regex (from nltk<4.0,>=3.2->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/8e/0a/6c702a8bb8fd025306b5109130f8e3489ba48b49033b37ca9e1227ec1b02/regex-2020.6.8-cp38-cp38-manylinux1_x86_64.whl (673kB)
remote: Collecting tqdm (from nltk<4.0,>=3.2->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/f3/76/4697ce203a3d42b2ead61127b35e5fcc26bba9a35c03b32a2bd342a4c869/tqdm-4.46.1-py2.py3-none-any.whl (63kB)
remote: Requirement already satisfied: setuptools in ./.heroku/python/lib/python3.8/site-packages (from pint>=0.8.1->chatterbot)
remote: Requirement already satisfied: six>=1.5 in ./.heroku/python/lib/python3.8/site-packages (from python-dateutil<2.9,>=2.8->chatterbot)
remote: Collecting numpy>=1.15.0 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/01/c6/87592f924246da1e58673cf708a2748754517c5cf050726238d6cfbd8df4/numpy-1.18.5-cp38-cp38-manylinux1_x86_64.whl (20.6MB)
remote: Collecting murmurhash<1.1.0,>=0.28.0 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/20/2d/798d60fdfdf4fcc16b9c73d9450183fb61fdb89e8d475fa94d07edfcd3b7/murmurhash-1.0.2-cp38-cp38-manylinux1_x86_64.whl
remote: Collecting cymem<2.1.0,>=2.0.2 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/41/2d/d24b1b980da72883a6a8dc5f9bdf48bcb892f3ac1579fb300045771693c3/cymem-2.0.3-cp38-cp38-manylinux1_x86_64.whl
remote: Collecting preshed<2.1.0,>=2.0.1 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/0b/14/c9aa735cb9c131545fc9e23031baccb87041ac9215b3d75f99e3cf18f6a3/preshed-2.0.1.tar.gz (113kB)
remote: Collecting thinc<7.1.0,>=7.0.8 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/92/39/ea2a3d5b87fd52fc865fd1ceb7b91dca1f85e227d53e7a086d260f6bcb93/thinc-7.0.8.tar.gz (1.9MB)
remote: Collecting blis<0.3.0,>=0.2.2 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/59/9e/84a83616cbe5daa94909da38b780e93bf566dc2113c3dc35d7b4cad52f63/blis-0.2.4.tar.gz (1.5MB)
remote: Collecting plac<1.0.0,>=0.9.6 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/9e/9b/62c60d2f5bc135d2aa1d8c8a86aaf84edb719a59c7f11a4316259e61a298/plac-0.9.6-py2.py3-none-any.whl
remote: Collecting requests<3.0.0,>=2.13.0 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl (58kB)
remote: Collecting wasabi<1.1.0,>=0.2.0 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/21/e1/e4e7b754e6be3a79c400eb766fb34924a6d278c43bb828f94233e0124a21/wasabi-0.6.0-py3-none-any.whl
remote: Collecting srsly<1.1.0,>=0.0.6 (from spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/1e/18/eff2f26419bf99a0a18acfe287d98a0bedb1a65618f86bdbe95c5acd580b/srsly-1.0.2-cp38-cp38-manylinux1_x86_64.whl (185kB)
remote: Requirement already satisfied: certifi>=2017.4.17 in ./.heroku/python/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy<2.2,>=2.1->chatterbot)
remote: Collecting chardet<4,>=3.0.2 (from requests<3.0.0,>=2.13.0->spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
remote: Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests<3.0.0,>=2.13.0->spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/e1/e5/df302e8017440f111c11cc41a6b432838672f5a70aa29227bf58149dc72f/urllib3-1.25.9-py2.py3-none-any.whl (126kB)
remote: Collecting idna<3,>=2.5 (from requests<3.0.0,>=2.13.0->spacy<2.2,>=2.1->chatterbot)
remote: Downloading https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl (58kB)
remote: Building wheels for collected packages: nltk, pyyaml, spacy, preshed, thinc, blis
remote: Running setup.py bdist_wheel for nltk: started
remote: Running setup.py bdist_wheel for nltk: finished with status 'done'
remote: Stored in directory: /app/.cache/pip/wheels/ae/8c/3f/b1fe0ba04555b08b57ab52ab7f86023639a526d8bc8d384306
remote: Running setup.py bdist_wheel for pyyaml: started
remote: Running setup.py bdist_wheel for pyyaml: finished with status 'done'
remote: Stored in directory: /app/.cache/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd
remote: Running setup.py bdist_wheel for spacy: started
remote: Running setup.py bdist_wheel for spacy: still running...
remote: Running setup.py bdist_wheel for spacy: still running...
remote: Running setup.py bdist_wheel for spacy: still running...
remote: Running setup.py bdist_wheel for spacy: still running...
remote: Running setup.py bdist_wheel for spacy: finished with status 'done'
remote: Stored in directory: /app/.cache/pip/wheels/08/fe/7f/19f370eb24ed7d428a7531429b20e6ea9195f320209a2295d8
remote: Running setup.py bdist_wheel for preshed: started
remote: Running setup.py bdist_wheel for preshed: finished with status 'done'
remote: Stored in directory: /app/.cache/pip/wheels/22/66/7a/672369bfbf391c645f57e937786f7a9c1ed4f225a4a73b0673
remote: Running setup.py bdist_wheel for thinc: started
remote: Running setup.py bdist_wheel for thinc: finished with status 'done'
remote: Stored in directory: /app/.cache/pip/wheels/f2/32/f0/fe1467f30fde6dd38ef58010310d2f114b99db79391ff8c0cb
remote: Running setup.py bdist_wheel for blis: started
remote: Running setup.py bdist_wheel for blis: still running...
remote: Running setup.py bdist_wheel for blis: still running...
remote: Running setup.py bdist_wheel for blis: still running...
remote: Running setup.py bdist_wheel for blis: finished with status 'done'
remote: Stored in directory: /app/.cache/pip/wheels/06/4a/3f/264f84e713c1e95acfcdb144f46cda3807ab314a864944690e
remote: Successfully built nltk pyyaml spacy preshed thinc blis
remote: Installing collected packages: mathparse, click, joblib, regex, tqdm, nltk, pint, python-dateutil, pyyaml, numpy, murmurhash, cymem, preshed, blis, wasabi, srsly, plac, thinc, chardet, urllib3, idna, requests, spacy, sqlalchemy, pytz, chatterbot
remote: Running setup.py develop for chatterbot
remote: Successfully installed blis-0.2.4 chardet-3.0.4 chatterbot click-7.1.2 cymem-2.0.3 idna-2.9 joblib-0.15.1 mathparse-0.1.2 murmurhash-1.0.2 nltk-3.5 numpy-1.18.5 pint-0.12 plac-0.9.6 preshed-2.0.1 python-dateutil-2.8.1 pytz-2020.1 pyyaml-5.3.1 regex-2020.6.8 requests-2.23.0 spacy-2.1.9 sqlalchemy-1.3.17 srsly-1.0.2 thinc-7.0.8 tqdm-4.46.1 urllib3-1.25.9 wasabi-0.6.0
remote:
remote: Adding -e git+https://github.com/mmoore7/ChatterBot.git#egg=chatterbot to Pipfile's [packages]…
remote: Creating a virtualenv for this project…
remote: Using /app/.heroku/python/bin/python (3.8.3) to create virtualenv…
remote: created virtual environment CPython3.8.3.final.0-64 in 792ms
remote: creator CPython3Posix(dest=/app/.local/share/virtualenvs/build_71e6813d471b0b6c3faf122c18c08200-75mJ028V, clear=False, global=False)
remote: seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/app/.local/share/virtualenv/seed-app-data/v1.0.1)
remote: activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
remote:
remote: Virtualenv location: /app/.local/share/virtualenvs/build_71e6813d471b0b6c3faf122c18c08200-75mJ028V
remote: Installing dependencies from Pipfile.lock (afd0bd)…
remote: WARNING: Invalid fragment string egg=en-core-web-sm==2.1.0
remote: ABORTING INSTALL... You will have to reinstall any packages that failed to install.
remote: You may have to manually run pipenv lock when you are finished.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to captain-hp-bot.
remote:
To https://git.heroku.com/captain-hp-bot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/captain-hp-bot.git'
So I think the pipenv version is the reason why it fails. There's a bug in the version it's using that prevents the app from compiling. The solution was to use a requirements.txt so heroku uses pip instead. Even after clearing the app's cache, it still would use the Pipfile from somewhere, so destroying the app and re-creating it with requirements.txt file resolved the issue.

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'

ModuleNotFoundError: No module named 'Xlib' when push python app to heroku

I want to deploy a python app on Heroku, i have tried pip install python3_xlib and pip install --upgrade setuptools, but still, I can't fix the error:
(ll_env) C:\Users\lyj\Desktop\Python_journey_code\learning_log>git push heroku master
Counting objects: 49, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (41/41), done.
Writing objects: 100% (49/49), 11.77 KiB | 388.00 KiB/s, done.
Total 49 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3.6 is python-3.6.6 (you are using python-3.6.5, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.6).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6.5
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting bottle==0.12.13 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 1))
remote: Downloading https://files.pythonhosted.org/packages/bd/99/04dc59ced52a8261ee0f965a8968717a255ea84a36013e527944dbf3468c/bottle-0.12.13.tar.gz (70kB)
remote: Collecting certifi==2018.4.16 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 2))
remote: Downloading https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl (150kB)
remote: Collecting chardet==3.0.4 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 3))
remote: Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
remote: Collecting cycler==0.10.0 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 4))
.......
remote: Collecting matplotlib==2.2.2 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 11))
remote: Downloading https://files.pythonhosted.org/packages/49/b8/89dbd27f2fb171ce753bb56220d4d4f6dbc5fe32b95d8edc4415782ef07f/matplotlib-2.2.2-cp36-cp36m-manylinux1_x86_64.whl (12.6MB)
remote: Collecting numpy==1.14.2 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 12))
remote: Downloading https://files.pythonhosted.org/packages/6e/dc/92c0f670e7b986829fc92c4c0208edb9d72908149da38ecda50d816ea057/numpy-1.14.2-cp36-cp36m-manylinux1_x86_64.whl (12.2MB)
remote: Collecting Pillow==5.1.0 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 13))
remote: Downloading https://files.pythonhosted.org/packages/5f/4b/8b54ab9d37b93998c81b364557dff9f61972c0f650efa0ceaf470b392740/Pillow-5.1.0-cp36-cp36m-manylinux1_x86_64.whl (2.0MB)
remote: Collecting PyAutoGUI==0.9.36 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 14))
remote: Downloading https://files.pythonhosted.org/packages/2e/83/89b5adbc37d1bbf7b486a2c1c00e8037e6f801e8c053c4897bb82d9510c6/PyAutoGUI-0.9.36.tar.gz (46kB)
remote: Complete output from command python setup.py egg_info:
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-build-dljfbbwj/PyAutoGUI/setup.py", line 6, in <module>
remote: version=__import__('pyautogui').__version__,
remote: File "/tmp/pip-build-dljfbbwj/PyAutoGUI/pyautogui/__init__.py", line 115, in <module>
remote: from . import _pyautogui_x11 as platformModule
remote: File "/tmp/pip-build-dljfbbwj/PyAutoGUI/pyautogui/_pyautogui_x11.py", line 7, in <module>
remote: from Xlib.display import Display
remote: ModuleNotFoundError: No module named 'Xlib'
remote:
remote: ----------------------------------------
remote: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dljfbbwj/PyAutoGUI/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to shielded-basin-12135.
remote:
To https://git.heroku.com/shielded-basin-12135.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/shielded-basin-12135.git'
For python3 try -
pip install python3-xlib

Categories

Resources