0

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

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

5 Comments

Thx. So how could I do to deal with it?
I think the simplest thing to do would be pip install configparser and remove the former ConfigParser from requirements by pip uninstall ConfigParser && pip freeze > requirements.txt. Try and see if this works
It's still not working when I push to heroku. Should I make some change based on the following stricpt? 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'
Should I delete the MySQL-python instead? like pip uninstall MySQL-python?
actually, try one of these pip install configparser or pip3 install configparser if those don't work try pip install ConfigParser or pip3 install ConfigParser. Also, if you think my answer to be sufficient please select it as the best answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.