heroku / heroku-geo-buildpack

37 stars 26 forks source link

error in GDAL setup command: use_2to3 is invalid #41

Closed berkedinc closed 2 years ago

berkedinc commented 2 years ago

I'm trying to deploy my GeoDjango app to Heroku.

First of all, I'm using the pack and followed the instructions.

I got the mentioned error and tried to search for answers. I took a look at this one

and tried but the same error comes up every single time. The project is built on Python 3.7.10 - I even tried this answer and changed the Python version to 3.9.13 - but nothing.

I get this error _"error in GDAL setup command: use2to3 is invalid."

Additionally, it says Numpy not available but I later installed it and refreshed the requirements.txt file.

### The error I get in detail:

remote:        Collecting GDAL==2.4.2
remote:          Downloading GDAL-2.4.2.tar.gz (564 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'error'
remote:          error: subprocess-exited-with-error
remote:
remote:          × python setup.py egg_info did not run successfully.
remote:          │ exit code: 1
remote:          ╰─> [6 lines of output]
remote:              WARNING: numpy not available!  Array support will not be enabled
remote:              /app/.heroku/python/lib/python3.9/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'use_2to3_fixers'
remote:                warnings.warn(msg)
remote:              /app/.heroku/python/lib/python3.9/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'use_2to3_exclude_fixers'
remote:                warnings.warn(msg)
remote:              error in GDAL setup command: use_2to3 is invalid.
remote:              [end of output]
remote:
remote:          note: This error originates from a subprocess, and is likely not a problem with pip.
remote:        error: metadata-generation-failed
remote:
remote:        × Encountered error while generating package metadata.
remote:        ╰─> See above for output.
remote:
remote:        note: This is an issue with the package mentioned above, not pip.
remote:        hint: See above for details.
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to project

### Requirements .txt:

asgiref==3.5.2
backports.zoneinfo==0.2.1
beautifulsoup4==4.11.1
certifi==2022.6.15
charset-normalizer==2.1.0
dj-database-url==1.0.0
Django==3.2.14
django-cors-headers==3.13.0
django-filter==22.1
django-heroku==0.3.1
djangorestframework==3.13.1
djangorestframework-gis==1.0
docopt==0.6.2
GDAL==2.4.2
gunicorn==20.1.0
idna==3.3
Js2Py==0.71
numpy==1.21.6
packaging==21.3
pipwin==0.5.2
psycopg2==2.9.3
pyjsparser==2.7.1
pyparsing==3.0.9
PyPrind==2.11.3
pySmartDL==1.3.4
python-dotenv==0.20.0
pytz==2022.1
pytz-deprecation-shim==0.1.0.post0
requests==2.28.1
Shapely==1.8.2
six==1.16.0
soupsieve==2.3.2.post1
sqlparse==0.4.2
typing_extensions==4.3.0
tzdata==2022.1
tzlocal==4.2
urllib3==1.26.11
whitenoise==6.2.0
edmorley commented 2 years ago

Searching for gdal use_2to3 is invalid using Duck Duck Go, I get: https://github.com/pypa/setuptools/issues/2781

Your GDAL package is old and is not compatible with newer setuptools. (This is not specific to Heroku or this buildpack)

Please update to a newer GDAL package version.