Python cannot be push to Heroku - python

I try to deploy a Django app to Heroku and the push get rejected. The result shows that : Push rejected, failed to compile Python app. From the error script, it seems that the model "ConfigParser' is not found.
I google this problem and it seems that the other guy also have this problem (https://github.com/hashedin/squealy/issues/229). Is it true that Python 3.7 could not work in Heroku? How could I deal with it? Some part of the detailed command result scripts are as followed:
remote: Collecting views==0.3 (from -r /tmp/build_ed5220ea80c3d6e758ae010 6d17c8450/requirements.txt (line 54))
remote: Downloading https://files.pythonhosted.org/packages/1b/d9/5598d 590f9467c364704397cbb0ebc9b33481b84e947c2af31cc1dc9fa11/views-0.3.tar.gz
remote: Collecting w3lib==1.19.0 (from -r /tmp/build_ed5220ea80c3d6e758ae 0106d17c8450/requirements.txt (line 55))
remote: Downloading https://files.pythonhosted.org/packages/37/94/40c93 ad0cadac0f8cb729e1668823c71532fd4a7361b141aec535acb68e3/w3lib-1.19.0-py2.py3-non e-any.whl
remote: Collecting Werkzeug==0.14.1 (from -r /tmp/build_ed5220ea80c3d6e75 8ae0106d17c8450/requirements.txt (line 56))
remote: Downloading https://files.pythonhosted.org/packages/20/c4/12e3e 56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3- none-any.whl (322kB)
remote: Collecting zope.interface==4.5.0 (from -r /tmp/build_ed5220ea80c3 d6e758ae0106d17c8450/requirements.txt (line 57))
remote: Downloading https://files.pythonhosted.org/packages/ac/8a/65753 2df378c2cd2a1fe6b12be3b4097521570769d4852ec02c24bd3594e/zope.interface-4.5.0.tar .gz (151kB)
remote: Collecting psycopg2>=2.6.1 (from -r /tmp/build_ed5220ea80c3d6e758 ae0106d17c8450/requirements.txt (line 58))
remote: Downloading https://files.pythonhosted.org/packages/37/88/40748 331bf75d068a07bbea7dc658faceb0ce2e9fffdde550e76d5475e59/psycopg2-2.7.5-cp37-cp37 m-manylinux1_x86_64.whl (2.7MB)
remote: Collecting MySQL-python (from mysql==0.0.1->-r /tmp/build_ed5220e a80c3d6e758ae0106d17c8450/requirements.txt (line 31))
remote: Downloading https://files.pythonhosted.org/packages/a5/e9/51b54 4da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip ( 108kB)
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-t_7e9for/MySQL-python/setup.py", line 13, in <module>
remote: from setup_posix import get_config
remote: File "/tmp/pip-build-t_7e9for/MySQL-python/setup_posix.py", line 2, in <module>
remote: from ConfigParser import SafeConfigParser
remote: ModuleNotFoundError: No module named 'ConfigParser'
remote:
remote: ----------------------------------------
remote: Command "python setup.py egg_info" failed with error code 1 in /t mp/pip-build-t_7e9for/MySQL-python/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to damp-brook-61138.
remote:
To https://git.heroku.com/damp-brook-61138.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/damp-brook-61138.git'
The requirements.txt is as:
asn1crypto==0.24.0
attrs==18.1.0
auth==0.5.3
Automat==0.7.0
beautifulsoup4==4.6.1
blinker==1.4
bs4==0.0.1
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
constantly==15.1.0
cryptography==2.3
cssselect==1.0.3
dj-database-url==0.5.0
dj-static==0.0.6
Django==2.1
django-bootstrap3==10.0.1
django-forms-bootstrap==3.1.0
dnspython==1.15.0
eventlet==0.24.1
falcon==1.4.1
greenlet==0.4.14
gunicorn==19.9.0
hyperlink==18.0.0
idna==2.7
incremental==17.5.0
lxml==4.2.4
misaka==2.1.0
mongoengine==0.15.3
monotonic==1.5
mysql==0.0.1
mysql-connector==2.1.6
mysqlclient==1.3.13
parsel==1.5.0
pyasn1==0.4.4
pyasn1-modules==0.2.2
pycparser==2.18
PyDispatcher==2.0.5
PyHamcrest==1.9.0
pymongo==3.7.1
PyMySQL==0.9.2
pyOpenSSL==18.0.0
python-mimeparse==1.6.0
pytz==2018.5
queuelib==1.5.0
requests==2.19.1
Scrapy==1.5.1
service-identity==17.0.0
six==1.11.0
static3==0.7.0
Twisted==18.7.0
typed-ast==1.1.0
urllib3==1.23
views==0.3
w3lib==1.19.0
Werkzeug==0.14.1
zope.interface==4.5.0
psycopg2>=2.6.1

Any chance this could be a python3 import error on the import for the module ConfigParser?
I hope this helps.
This is Abe Karplus's answer:
In Python 3, ConfigParser has been renamed to configparser for PEP 8 compliance. It looks like the package you are installing does not support Python 3.

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

heroku pip requirements.txt google-cloud-speech fails

I have a requirements.txt in my python/django project. Everything has worked fine, locally as well, until I tried to include google-cloud-speech in my requirements and deploying to heroku. It has failed since then and I'm not sure why. (I have deployed to heroku numerous times before this)
I'm following this example here: https://cloud.google.com/speech-to-text/docs/libraries
Test locally, everything compiles and endpoints work correctly with the imports of:
from google.cloud import speech_v1p1beta1
from google.cloud.speech_v1p1beta1 import enums
Steps to reproduce:
In my virtualenv
pip install -r requirements.txt
python manage.py runserver [works]
run endpoint for speech transcription [works]
git push heroku master [fails]
Here's the output:
remote: $ pip install -r requirements.txt
remote: Collecting google-cloud-speech==1.3.2 (from -r requirements.txt (line 25))
remote: Downloading https://files.pythonhosted.org/packages/5c/4b/76ec278f9ac5b6a525d222d7539cc473cca41f639a571177301a5115d0b3/google_cloud_speech-1.3.2-py2.py3-none-any.whl (88kB)
remote: Collecting setuptools==49.2.0 (from -r requirements.txt (line 50))
remote: Downloading https://files.pythonhosted.org/packages/8e/11/9e10f1cad4518cb307b484c255cae61e97f05b82f6d536932b1714e01b47/setuptools-49.2.0-py3-none-any.whl (789kB)
remote: Collecting pip>=9.0.1 (from pipenv==2018.11.26->-r requirements.txt (line 36))
remote: Downloading https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl (1.5MB)
remote: Collecting grpcio<2.0dev,>=1.29.0 (from google-api-core[grpc]<2.0.0dev,>=1.14.0->google-cloud-speech==1.3.2->-r requirements.txt (line 25))
remote: Downloading https://files.pythonhosted.org/packages/5e/29/1bd649737e427a6bb850174293b4f2b72ab80dd49462142db9b81e1e5c7b/grpcio-1.30.0.tar.gz (19.7MB)
remote: Exception:
remote: Traceback (most recent call last):
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/_vendor/pkg_resources/__init__.py", line 2610, in _dep_map
remote: return self.__dep_map
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/_vendor/pkg_resources/__init__.py", line 2685, in __getattr__
remote: raise AttributeError(attr)
remote: AttributeError: _Distribution__dep_map
remote:
remote: During handling of the above exception, another exception occurred:
remote:
remote: Traceback (most recent call last):
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/basecommand.py", line 209, in main
remote: status = self.run(options, args)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/commands/install.py", line 299, in run
remote: requirement_set.prepare_files(finder)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/req/req_set.py", line 360, in prepare_files
remote: ignore_dependencies=self.ignore_dependencies))
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/req/req_set.py", line 647, in _prepare_file
remote: set(req_to_install.extras) - set(dist.extras)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/_vendor/pkg_resources/__init__.py", line 2810, in extras
remote: return [dep for dep in self._dep_map if dep]
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/_vendor/pkg_resources/__init__.py", line 2624, in _dep_map
remote: dm.setdefault(extra,[]).extend(parse_requirements(reqs))
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/_vendor/pkg_resources/__init__.py", line 2980, in parse_requirements
remote: "version spec")
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip-8.1.1-py3.6.egg/pip/_vendor/pkg_resources/__init__.py", line 2956, in scan_list
remote: raise RequirementParseError(msg, line, "at", line[p:])
remote: pip._vendor.pkg_resources.RequirementParseError: Expected ',' or end-of-list in futures>=2.2.0; python_version<'3.2' at ; python_version<'3.2'
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
Here's my requirements.txt
apns2==0.7.1
asn1crypto==1.1.0
boto3==1.9.250
botocore==1.12.251
certifi==2019.9.11
cffi==1.13.0
celery==4.4.1
chardet==3.0.4
cryptography==2.9
Django==2.2.4
django-bootstrap4==0.0.8
django-cors-headers==3.2.0
django-extensions==2.2.9
django-filter==2.2.0
django-heroku==0.3.1
django-rest-framework-social-oauth2==1.1.0
django-storages==1.7.1
djangorestframework==3.10.3
dj-database-url==0.5.0
dj-stripe==2.3.0
docutils==0.15.2
gunicorn==20.0.4
gcloud==0.18.3
google-cloud-storage==1.29.0
google-cloud-speech==1.3.2
google-api-python-client==1.10.0
h2==2.6.2
hpack==3.0.0
hyper==0.7.0
hyperframe==3.2.0
idna==2.8
jmespath==0.9.4
nltk==3.5
pandas==1.0.3
Pillow==7.1.2
pipenv==2018.11.26
psycopg2-binary
pycparser==2.19
pydub==0.24.1
PyJWT==1.7.1
python-dateutil==2.8.0
pytest==5.4.1
pytest-django==3.8.0
pytz==2019.2
redis==3.4.1
requests==2.22.0
rest-social-auth==2.0.2
s3transfer==0.2.1
sendgrid==6.3.1
six==1.12.0
stripe==2.48.0
sqlparse==0.3.0
urllib3==1.24.3
virtualenv==16.7.6
virtualenv-clone==0.5.3
I ended up having to downgrade my versions of grpcio and google-core-api to resolve this. Lots of trial and error so I don't really have a root cause to share unfortunately.

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

Heroku build fails always - Says no module named six

Counting objects: 1260, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1208/1208), done.
Writing objects: 100% (1260/1260), 6.24 MiB | 184.00 KiB/s, done.
Total 1260 (delta 109), 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: Collecting appdirs==1.4.3 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 1))
remote: Downloading appdirs-1.4.3-py2.py3-none-any.whl
remote: Collecting click==6.7 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 2))
remote: Downloading click-6.7-py2.py3-none-any.whl (71kB)
remote: Collecting Flask==0.12.2 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 3))
remote: Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
remote: Collecting gunicorn==19.7.1 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 4))
remote: Downloading gunicorn-19.7.1-py2.py3-none-any.whl (111kB)
remote: Collecting itsdangerous==0.24 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 5))
remote: Downloading itsdangerous-0.24.tar.gz (46kB)
remote: Collecting Jinja2==2.9.6 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 6))
remote: Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB)
remote: Collecting MarkupSafe==1.0 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 7))
remote: Downloading MarkupSafe-1.0.tar.gz
remote: Collecting packaging==16.8 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 8))
remote: Downloading packaging-16.8-py2.py3-none-any.whl
remote: Collecting pyparsing==2.2.0 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 9))
remote: Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
remote: Collecting six==1.10.0 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 10))
remote: Downloading six-1.10.0-py2.py3-none-any.whl
remote: Collecting Werkzeug==0.12.2 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 11))
remote: Downloading Werkzeug-0.12.2-py2.py3-none-any.whl (312kB)
remote: Installing collected packages: appdirs, click, itsdangerous, Werkzeug, MarkupSafe, Jinja2, Flask, gunicorn, pyparsing, six, packaging
remote: Running setup.py install for itsdangerous: started
remote: Running setup.py install for itsdangerous: finished with status 'error'
remote: Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-H6YgNg/itsdangerous/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-VAC6vv-record/install-record.txt --single-version-externally-managed --compile:
remote: running install
remote: running build
remote: running build_py
remote: creating build
remote: creating build/lib
remote: copying itsdangerous.py -> build/lib
remote: running install_lib
remote: copying build/lib/itsdangerous.py -> /app/.heroku/python/lib/python2.7/site-packages
remote: byte-compiling /app/.heroku/python/lib/python2.7/site-packages/itsdangerous.py to itsdangerous.pyc
remote: running install_egg_info
remote: running egg_info
remote: writing itsdangerous.egg-info/PKG-INFO
remote: writing top-level names to itsdangerous.egg-info/top_level.txt
remote: writing dependency_links to itsdangerous.egg-info/dependency_links.txt
remote: reading manifest file 'itsdangerous.egg-info/SOURCES.txt'
remote: reading manifest template 'MANIFEST.in'
remote: writing manifest file 'itsdangerous.egg-info/SOURCES.txt'
remote: Copying itsdangerous.egg-info to /app/.heroku/python/lib/python2.7/site-packages/itsdangerous-0.24-py2.7.egg-info
remote: running install_scripts
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-build-H6YgNg/itsdangerous/setup.py", line 20, in <module>
remote: 'Programming Language :: Python :: 3',
remote: File "/app/.heroku/python/lib/python2.7/distutils/core.py", line 151, in setup
remote: dist.run_commands()
remote: File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 953, in run_commands
remote: self.run_command(cmd)
remote: File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 972, in run_command
remote: cmd_obj.run()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
remote: return orig.install.run(self)
remote: File "/app/.heroku/python/lib/python2.7/distutils/command/install.py", line 575, in run
remote: self.run_command(cmd_name)
remote: File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 326, in run_command
remote: self.distribution.run_command(command)
remote: File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 972, in run_command
remote: cmd_obj.run()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 17, in run
remote: import setuptools.command.easy_install as ei
remote: File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 49, in <module>
remote: from setuptools.py27compat import rmtree_safe
remote: File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/py27compat.py", line 7, in <module>
remote: import six
remote: ImportError: No module named six
remote:
remote: ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-H6YgNg/itsdangerous/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-VAC6vv-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-H6YgNg/itsdangerous/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to searchword.
remote:
To https://git.heroku.com/searchword.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/searchword.git'
I don't know what is happening. Few days ago, I was able to deploy apps on heroku with no such error. I am running on virtual environment. I activated it before pushing to heroku master. I even checked which pip I am referring to but all in vain. I have installed module 'six' on my local machine and on virtual environment even. Still always it says No module named six and fails my deploy. Please help!! Its frustrating!
Because it is google translation, I'm sorry if it turned funny.
I was addicted in exactly the same situation.
I do not know why it went well, but I replaced it to describe
"six == 1.10.0" at the beginning of "requirements.txt" and deployed it.
by the way, but my version of python is 3.6・・・
This is an issue currently with the latest release of setuptools (36.0.0). You can track the issue here - https://github.com/pypa/setuptools/issues/1042
I solved this issue by removing the module needing six from the reqirements.txt. Then push to heroku and the build was succesful. Next I added the package which needed six and it worked.

Error importing storage module.whitenoise.django

I'm trying to deploy a basic Django app to Heroku, but am getting an error when I try to deploy.
It looks like the error is with whitenoise. I have six installed as part of my requirements so it should handle urllib.parse.
Here is the error:
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/files/storage.py", line 290, in get_storage_class
remote: raise ImproperlyConfigured('Error importing storage module %s: "%s"' % (module, e))
remote: django.core.exceptions.ImproperlyConfigured: Error importing storage module whitenoise.django: "No module named urllib.parse"
remote:
remote: ! Error while running '$ python manage.py collectstatic --noinput'.
Here is the full stack:
remote:
remote: -----> Python app detected
remote: -----> Uninstalling stale dependencies
remote: Uninstalling DateTime-4.1.1:
remote: Successfully uninstalled DateTime-4.1.1
remote: Uninstalling simplejson-3.8.2:
remote: Successfully uninstalled simplejson-3.8.2
remote: -----> Noticed cffi. Bootstrapping libffi.
remote: $ pip install -r requirements.txt
remote: Collecting altgraph==0.10.2 (from -r requirements.txt (line 1))
remote: Downloading altgraph-0.10.2.tar.gz (481kB)
remote: Collecting bdist-mpkg==0.5.0 (from -r requirements.txt (line 2))
remote: Downloading bdist_mpkg-0.5.0.tar.gz
remote: Collecting bpython==0.12 (from -r requirements.txt (line 3))
remote: Downloading bpython-0.12.tar.gz (130kB)
remote: Collecting csvkit==0.7.3 (from -r requirements.txt (line 4))
remote: Downloading csvkit-0.7.3.tar.gz
remote: Collecting Cython==0.19.2 (from -r requirements.txt (line 5))
remote: Downloading Cython-0.19.2-cp27-cp27m-manylinux1_x86_64.whl (4.0MB)
remote: Collecting dbf==0.94.3 (from -r requirements.txt (line 6))
remote: Downloading dbf-0.94.003.tar.gz (79kB)
remote: Collecting dj-database-url==0.4.1 (from -r requirements.txt (line 7))
remote: Downloading dj-database-url-0.4.1.tar.gz
remote: Collecting Django==1.5.4 (from -r requirements.txt (line 8))
remote: Downloading Django-1.5.4.tar.gz (8.1MB)
remote: Collecting future==0.11.2 (from -r requirements.txt (line 9))
remote: Downloading future-0.11.2.tar.gz (321kB)
remote: Collecting futures==3.0.5 (from -r requirements.txt (line 10))
remote: Downloading futures-3.0.5-py2-none-any.whl
remote: Collecting greenlet==0.4.1 (from -r requirements.txt (line 11))
remote: Downloading greenlet-0.4.1.zip (75kB)
remote: Collecting grequests==0.2.0 (from -r requirements.txt (line 12))
remote: Downloading grequests-0.2.0.tar.gz
remote: Collecting gunicorn==19.6.0 (from -r requirements.txt (line 13))
remote: Downloading gunicorn-19.6.0-py2.py3-none-any.whl (114kB)
remote: Collecting humanize==0.5 (from -r requirements.txt (line 14))
remote: Downloading humanize-0.5.tar.gz
remote: Collecting iso8601==0.1.8 (from -r requirements.txt (line 15))
remote: Downloading iso8601-0.1.8.tar.gz
remote: Collecting livestreamer==1.12.2 (from -r requirements.txt (line 16))
remote: Downloading livestreamer-1.12.2.tar.gz (430kB)
remote: Collecting macholib==1.5.1 (from -r requirements.txt (line 17))
remote: Downloading macholib-1.5.1.tar.gz (454kB)
remote: Collecting modulegraph==0.10.4 (from -r requirements.txt (line 18))
remote: Downloading modulegraph-0.10.4.tar.gz (532kB)
remote: Collecting MySQL-python==1.2.4 (from -r requirements.txt (line 19))
remote: Downloading MySQL-python-1.2.4.zip (113kB)
remote: Collecting openpyxl==2.0.3 (from -r requirements.txt (line 20))
remote: Downloading openpyxl-2.0.3.tar.gz (113kB)
remote: Collecting py2app==0.7.3 (from -r requirements.txt (line 21))
remote: Downloading py2app-0.7.3.tar.gz (1.2MB)
remote: Collecting pycrypto==2.6.1 (from -r requirements.txt (line 22))
remote: Downloading pycrypto-2.6.1.tar.gz (446kB)
remote: Collecting pycurl==7.19.0.2 (from -r requirements.txt (line 23))
remote: Downloading pycurl-7.19.0.2.tar.gz (89kB)
remote: Collecting Pygments==1.6 (from -r requirements.txt (line 24))
remote: Downloading Pygments-1.6.tar.gz (1.4MB)
remote: Collecting pyOpenSSL==0.13.1 (from -r requirements.txt (line 25))
remote: Downloading pyOpenSSL-0.13.1.tar.gz (254kB)
remote: Collecting pyparsing==2.0.1 (from -r requirements.txt (line 26))
remote: Downloading pyparsing-2.0.1.tar.gz (1.1MB)
remote: Collecting python-dateutil==1.5 (from -r requirements.txt (line 27))
remote: Downloading python-dateutil-1.5.tar.gz (233kB)
remote: Collecting pytz==2013.7 (from -r requirements.txt (line 28))
remote: Downloading pytz-2013.7.tar.bz2 (177kB)
remote: Collecting requests==2.0.1 (from -r requirements.txt (line 29))
remote: Downloading requests-2.0.1-py2.py3-none-any.whl (439kB)
remote: Collecting singledispatch==3.4.0.3 (from -r requirements.txt (line 30))
remote: Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl
remote: Collecting six==1.4.1 (from -r requirements.txt (line 31))
remote: Downloading six-1.4.1.tar.gz
remote: Collecting SQLAlchemy==0.9.4 (from -r requirements.txt (line 32))
remote: Downloading SQLAlchemy-0.9.4.tar.gz (4.5MB)
remote: Collecting virtualenv==15.0.3 (from -r requirements.txt (line 33))
remote: Downloading virtualenv-15.0.3-py2.py3-none-any.whl (3.5MB)
remote: Collecting whitenoise==3.2.2 (from -r requirements.txt (line 34))
remote: Downloading whitenoise-3.2.2-py2.py3-none-any.whl
remote: Collecting xattr==0.6.4 (from -r requirements.txt (line 35))
remote: Downloading xattr-0.6.4.tar.gz
remote: Collecting xlrd==0.9.3 (from -r requirements.txt (line 36))
remote: Downloading xlrd-0.9.3.tar.gz (178kB)
remote: Collecting zope.interface==4.1.1 (from -r requirements.txt (line 37))
remote: Downloading zope.interface-4.1.1.tar.gz (864kB)
remote: Collecting gevent (from grequests==0.2.0->-r requirements.txt (line 12))
remote: Downloading gevent-1.1.2-cp27-cp27m-manylinux1_x86_64.whl (1.3MB)
remote: Collecting jdcal (from openpyxl==2.0.3->-r requirements.txt (line 20))
remote: Downloading jdcal-1.3.tar.gz
remote: Installing collected packages: altgraph, bdist-mpkg, Pygments, bpython, xlrd, python-dateutil, SQLAlchemy, jdcal, openpyxl, dbf, csvkit, Cython, dj-database-url, Django, future, futures, greenlet, gevent, requests, grequests, gunicorn, humanize, iso8601, six, singledispatch, livestreamer, macholib, modulegraph, MySQL-python, py2app, pycrypto, pycurl, pyOpenSSL, pyparsing, pytz, virtualenv, whitenoise, xattr, zope.interface
remote: Running setup.py install for altgraph: started
remote: Running setup.py install for altgraph: finished with status 'done'
remote: Running setup.py install for bdist-mpkg: started
remote: Running setup.py install for bdist-mpkg: finished with status 'done'
remote: Running setup.py install for Pygments: started
remote: Running setup.py install for Pygments: finished with status 'done'
remote: Running setup.py install for bpython: started
remote: Running setup.py install for bpython: finished with status 'done'
remote: Running setup.py install for xlrd: started
remote: Running setup.py install for xlrd: finished with status 'done'
remote: Running setup.py install for python-dateutil: started
remote: Running setup.py install for python-dateutil: finished with status 'done'
remote: Running setup.py install for SQLAlchemy: started
remote: Running setup.py install for SQLAlchemy: finished with status 'done'
remote: Running setup.py install for jdcal: started
remote: Running setup.py install for jdcal: finished with status 'done'
remote: Running setup.py install for openpyxl: started
remote: Running setup.py install for openpyxl: finished with status 'done'
remote: Running setup.py install for dbf: started
remote: Running setup.py install for dbf: finished with status 'done'
remote: Running setup.py install for csvkit: started
remote: Running setup.py install for csvkit: finished with status 'done'
remote: Running setup.py install for dj-database-url: started
remote: Running setup.py install for dj-database-url: finished with status 'done'
remote: Running setup.py install for Django: started
remote: Running setup.py install for Django: finished with status 'done'
remote: Running setup.py install for future: started
remote: Running setup.py install for future: finished with status 'done'
remote: Running setup.py install for greenlet: started
remote: Running setup.py install for greenlet: finished with status 'done'
remote: Found existing installation: requests 2.11.1
remote: Uninstalling requests-2.11.1:
remote: Successfully uninstalled requests-2.11.1
remote: Running setup.py install for grequests: started
remote: Running setup.py install for grequests: finished with status 'done'
remote: Running setup.py install for humanize: started
remote: Running setup.py install for humanize: finished with status 'done'
remote: Running setup.py install for iso8601: started
remote: Running setup.py install for iso8601: finished with status 'done'
remote: Running setup.py install for six: started
remote: Running setup.py install for six: finished with status 'done'
remote: Running setup.py install for livestreamer: started
remote: Running setup.py install for livestreamer: finished with status 'done'
remote: Running setup.py install for macholib: started
remote: Running setup.py install for macholib: finished with status 'done'
remote: Running setup.py install for modulegraph: started
remote: Running setup.py install for modulegraph: finished with status 'done'
remote: Running setup.py install for MySQL-python: started
remote: Running setup.py install for MySQL-python: finished with status 'done'
remote: Running setup.py install for py2app: started
remote: Running setup.py install for py2app: finished with status 'done'
remote: Running setup.py install for pycrypto: started
remote: Running setup.py install for pycrypto: finished with status 'done'
remote: Running setup.py install for pycurl: started
remote: Running setup.py install for pycurl: finished with status 'done'
remote: Running setup.py install for pyOpenSSL: started
remote: Running setup.py install for pyOpenSSL: finished with status 'done'
remote: Running setup.py install for pyparsing: started
remote: Running setup.py install for pyparsing: finished with status 'done'
remote: Found existing installation: pytz 2016.7
remote: Uninstalling pytz-2016.7:
remote: Successfully uninstalled pytz-2016.7
remote: Running setup.py install for pytz: started
remote: Running setup.py install for pytz: finished with status 'done'
remote: Running setup.py install for xattr: started
remote: Running setup.py install for xattr: finished with status 'done'
remote: Found existing installation: zope.interface 4.3.2
remote: Uninstalling zope.interface-4.3.2:
remote: Successfully uninstalled zope.interface-4.3.2
remote: Running setup.py install for zope.interface: started
remote: Running setup.py install for zope.interface: finished with status 'done'
remote: Successfully installed Cython-0.19.2 Django-1.5.4 MySQL-python-1.2.4 Pygments-1.6 SQLAlchemy-0.9.4 altgraph-0.10.2 bdist-mpkg-0.5.0 bpython-0.12 csvkit-0.7.3 dbf-0.94.3 dj-database-url-0.4.1 future-0.11.2 futures-3.0.5 gevent-1.1.2 greenlet-0.4.1 grequests-0.2.0 gunicorn-19.6.0 humanize-0.5 iso8601-0.1.8 jdcal-1.3 livestreamer-1.12.2 macholib-1.5.1 modulegraph-0.10.4 openpyxl-2.0.3 py2app-0.7.3 pyOpenSSL-0.13.1 pycrypto-2.6.1 pycurl-7.19.0.2 pyparsing-2.0.1 python-dateutil-1.5 pytz-2013.7 requests-2.0.1 singledispatch-3.4.0.3 six-1.4.1 virtualenv-15.0.3 whitenoise-3.2.2 xattr-0.6.4 xlrd-0.9.3 zope.interface-4.1.1
remote:
remote: $ python manage.py collectstatic --noinput
remote: Traceback (most recent call last):
remote: File "manage.py", line 10, in <module>
remote: execute_from_command_line(sys.argv)
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
remote: utility.execute()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
remote: self.fetch_command(subcommand).run_from_argv(self.argv)
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
remote: klass = load_command_class(app_name, subcommand)
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 78, in load_command_class
remote: return module.Command()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 58, in __init__
remote: self.storage.path('')
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/functional.py", line 204, in inner
remote: self._setup()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py", line 307, in _setup
remote: self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/files/storage.py", line 290, in get_storage_class
remote: raise ImproperlyConfigured('Error importing storage module %s: "%s"' % (module, e))
remote: django.core.exceptions.ImproperlyConfigured: Error importing storage module whitenoise.django: "No module named urllib.parse"
remote:
remote: ! Error while running '$ python manage.py collectstatic --noinput'.
remote: See traceback above for details.
remote:
remote: You may need to update application code to resolve this error.
remote: Or, you can disable collectstatic for this application:
remote:
remote: $ heroku config:set DISABLE_COLLECTSTATIC=1
remote:
remote: https://devcenter.heroku.com/articles/django-assets
remote: ! Push rejected, failed to compile Python app.
You're using an unsupported version of Django. Django 1.5 has been out of mainstream support for three years, and out of extended support for two.
See here: https://www.djangoproject.com/download/#supported-versions
The latest version of WhiteNoise is tested with Django 1.8 and up.

Categories

Resources