- Install PostgreSQL with PostGIS via Postges.app
- Install brew as recommended.
- Install dependencies:
brew install geos gdal
- Add the following to your settings:
# settings.py GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH') GEOS_LIBRARY_PATH = os.getenv('GEOS_LIBRARY_PATH')
- Run Django with the following command, or set variables in your local enviornmeht:
GDAL_LIBRARY_PATH=/opt/homebrew/lib/libgdal.dylib GEOS_LIBRARY_PATH=/opt/homebrew/lib/libgeos_c.dylib ./manage.py runserver
Created
March 11, 2021 10:29
-
-
Save codingjoe/a31405952ec936beba99b059e665491e to your computer and use it in GitHub Desktop.
HowTo run GeoDjango and PostGIS on M1 macOS arm64 MacBook
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what is the solution even I tried
arch -x86_64 /usr/local/homebrew/bin/brew install gdal
but it failed to installgobject-introspection
error
FAILED: tests/scanner/SLetter-1.0.gir
/private/tmp/gobject-introspection-20230418-13944-1ckcej3/gobject-introspection-1.76.1/build/tools/g-ir-scanner --quiet --output=tests/scanner/SLetter-1.0.gir --no-libtool --reparse-validate --add-include-path /private/tmp/gobject-introspection-20230418-13944-1ckcej3/gobject-introspection-1.76.1/gir --add-include-path /private/tmp/gobject-introspection-20230418-13944-1ckcej3/gobject-introspection-1.76.1/build/gir --warn-all --warn-error --namespace=SLetter --nsversion=1.0 --identifier-prefix=S --include=Gio-2.0 --library=sletter-1.0 --c-include=sletter.h -L /private/tmp/gobject-introspection-20230418-13944-1ckcej3/gobject-introspection-1.76.1/build/tests/scanner -I /private/tmp/gobject-introspection-20230418-13944-1ckcej3/gobject-introspection-1.76.1/tests/scanner -I /private/tmp/gobject-introspection-20230418-13944-1ckcej3/gobject-introspection-1.76.1/tests/scanner/.. ../tests/scanner/sletter.c ../tests/scanner/sletter.h
Error in sitecustomize; set PYTHONVERBOSE for traceback:
NameError: name 'new_prefix' is not defined
:: Warning: SLetter: (ErrorQuarkFunction)spawn_error_quark: s_spawn_error_quark: return value: Unresolved type: 'GQuark'
:: Warning: SLetter: (ErrorQuarkFunction)dbus_error_quark: s_dbus_error_quark: return value: Unresolved type: 'GQuark'
:: Fatal: SLetter: warnings configured as fatal
:: Fatal: SLetter: warnings configured as fatal