- 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
-
-
Save codingjoe/a31405952ec936beba99b059e665491e to your computer and use it in GitHub Desktop.
You saved me!
❤️ Thanks, and I don't even own an M1 yet 😉
Thanks~
mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')
I am actually getting this error. Tried brew gdal path and conda gdal.
using M1 Pro mac, Python 3.8
mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')
I am actually getting this error. Tried brew gdal path and conda gdal. using M1 Pro mac, Python 3.8
Hi @imtipu, thanks for reaching out. It looks to me, you are running your terminal via Rosetta in x86_64
-mode. You don't need that, and I wouldn't recommend to. You can get everything for arm64
these days via Homebrew. A quick uname -m
should show you what architecture you are running.
Yet another approach ln -s /opt/homebrew/lib ~/lib
mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')
I am actually getting this error. Tried brew gdal path and conda gdal. using M1 Pro mac, Python 3.8Hi @imtipu, thanks for reaching out. It looks to me, you are running your terminal via Rosetta in
x86_64
-mode. You don't need that, and I wouldn't recommend to. You can get everything forarm64
these days via Homebrew. A quickuname -m
should show you what architecture you are running.
what is the solution even I tried arch -x86_64 /usr/local/homebrew/bin/brew install gdal
but it failed to install gobject-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
You saved me!