New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for running Django on Darwin/macOS #27685
Labels
Comments
--- a/django/contrib/gis/gdal/libgdal.py
+++ b/django/contrib/gis/gdal/libgdal.py
@@ -17,7 +17,11 @@ try:
lib_path = settings.GDAL_LIBRARY_PATH
except (AttributeError, EnvironmentError,
ImportError, ImproperlyConfigured):
- lib_path = None
+ from platform import system as _system
+ if _system() == "Darwin":
+ lib_path = "@gdal@/lib/libgdal.dylib"
+ else:
+ lib_path = "@gdal@/lib/libgdal.so"
if lib_path:
lib_names = None
diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py
--- a/django/contrib/gis/geos/libgeos.py
+++ b/django/contrib/gis/geos/libgeos.py
@@ -26,7 +26,11 @@ try:
lib_path = settings.GEOS_LIBRARY_PATH
except (AttributeError, EnvironmentError,
ImportError, ImproperlyConfigured):
- lib_path = None
+ from platform import system as _system
+ if _system() == "Darwin":
+ lib_path = "@geos@/lib/libgeos_c.dylib"
+ else:
+ lib_path = "@geos@/lib/libgeos_c.so"
# Setting the appropriate names for the GEOS-C library.
if lib_path: |
LnL7
added
6.topic: darwin
Running or building packages on Darwin
6.topic: python
labels
Jul 27, 2017
👍 , just ran into this issue. |
@svniemeijer you can use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description
The latest python Django versions (1.10/1.11) are dependent on GEOS/GDAL.
The existing patch script
1.10-gis-libs.template.patch
hardcodes a.so
library as default path, but this should be.dylib
libraries on Darwin.The attached 'patch to the patch' fixes this.
Steps to reproduce
Install Django package on Darwin.
Technical details
grep build-use-sandbox /etc/nix/nix.conf
)The text was updated successfully, but these errors were encountered: