call-tracking-django icon indicating copy to clipboard operation
call-tracking-django copied to clipboard

New error when setting up on heroku

Open jagehring opened this issue 8 years ago • 4 comments

@atbaker Here is the new error

-----> Python app detected -----> Installing python-3.6.2 -----> Installing pip -----> Installing requirements with pip Collecting Django==1.8 (from -r /tmp/build_7aaf2fe3a538e93211d2215435edf738/TwilioDevEd-call-tracking-django-deba9ef/requirements.txt (line 4)) Downloading Django-1.8-py2.py3-none-any.whl (6.2MB) Collecting django-bootstrap3==6.1.0 (from -r /tmp/build_7aaf2fe3a538e93211d2215435edf738/TwilioDevEd-call-tracking-django-deba9ef/requirements.txt (line 7)) Downloading django-bootstrap3-6.1.0.tar.gz Collecting django-forms-bootstrap==3.0.1 (from -r /tmp/build_7aaf2fe3a538e93211d2215435edf738/TwilioDevEd-call-tracking-django-deba9ef/requirements.txt (line 8)) Downloading django-forms-bootstrap-3.0.1.tar.gz Collecting django-phonenumber-field==0.7.2 (from -r /tmp/build_7aaf2fe3a538e93211d2215435edf738/TwilioDevEd-call-tracking-django-deba9ef/requirements.txt (line 9)) Downloading django-phonenumber-field-0.7.2.tar.gz Collecting phonenumbers==7.0.8 (from -r /tmp/build_7aaf2fe3a538e93211d2215435edf738/TwilioDevEd-call-tracking-django-deba9ef/requirements.txt (line 10)) Downloading phonenumbers-7.0.8.tar.gz (2.1MB) Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-gbu5ivfl/phonenumbers/setup.py", line 33, in from phonenumbers import version File "/tmp/pip-build-gbu5ivfl/phonenumbers/phonenumbers/init.py", line 132, in from .phonenumbermatcher import PhoneNumberMatch, PhoneNumberMatcher, Leniency File "/tmp/pip-build-gbu5ivfl/phonenumbers/phonenumbers/phonenumbermatcher.py", line 161, in re.compile(u("(?u)(?:\p{Z}-|-\s)\s*(.+)")), File "/app/.heroku/python/lib/python3.6/re.py", line 233, in compile return _compile(pattern, flags) File "/app/.heroku/python/lib/python3.6/re.py", line 301, in _compile p = sre_compile.compile(pattern, flags) File "/app/.heroku/python/lib/python3.6/sre_compile.py", line 562, in compile p = sre_parse.parse(p, flags) File "/app/.heroku/python/lib/python3.6/sre_parse.py", line 855, in parse p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0) File "/app/.heroku/python/lib/python3.6/sre_parse.py", line 416, in _parse_sub not nested and not items)) File "/app/.heroku/python/lib/python3.6/sre_parse.py", line 765, in _parse p = _parse_sub(source, state, sub_verbose, nested + 1) File "/app/.heroku/python/lib/python3.6/sre_parse.py", line 416, in _parse_sub not nested and not items)) File "/app/.heroku/python/lib/python3.6/sre_parse.py", line 502, in _parse code = _escape(source, this, state) File "/app/.heroku/python/lib/python3.6/sre_parse.py", line 401, in _escape raise source.error("bad escape %s" % escape, len(escape)) sre_constants.error: bad escape \p at position 7

   ----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-gbu5ivfl/phonenumbers/ ! Push rejected, failed to compile Python app. ! Push failed

jagehring avatar Oct 14 '17 20:10 jagehring

This was very painful but it seems to have something to do with with an issue using setuptools and distutils/setup.py in the same environment.

What worked for me:

  1. set collect static to false using heroku config:set DISABLE_COLLECTSTATIC=1
  2. remove django-phonenumber-field from requirements.txt
  3. add latest version of setuptools to requirements.txt
  4. deploy to heroku
  5. set collect static to true using heroku config:set DISABLE_COLLECTSTATIC=0
  6. add django-phonenumber-field to requirements.txt
  7. deploy to heroku

skamensky avatar Mar 29 '18 06:03 skamensky

Installing requirements in virtualenv on windows returns the same error

thecompoundingdev avatar Apr 29 '19 16:04 thecompoundingdev

@skamensky how do you set collect static to false for an app if the app doesn't show up in heroku because it can't be built?

thecompoundingdev avatar Apr 29 '19 18:04 thecompoundingdev

I found another solution.

  1. Edit requirements.txt
  2. Change the following:

phonenumbers==7.6 psycopg2

ababen avatar Apr 26 '20 01:04 ababen