Open pasqui23 opened 5 years ago
Install Django
How? I take it you pip-installed something. How is that supposed to find GDAL?
The description of pygdal says it is "virtulalenv friendly".I thought that it would find automatically GDAL if it were installed on the system.
I have also installed gdal( not the python package) globally,but still gives this error even with GEOS_LIBRARY_PATH ="/run/current-system/sw/lib/" or GEOS_LIBRARY_PATH ="/run/current-system/sw/lib/libgdal.so"
Hi,
Sorry I only see this issue now. I hope that my answer is not too late and can still be usefull.
In nixpkgs, django's gdal support is optional in order to limit the closure size when using django.
To use gdal support, you need to override django (locally or globally) and use the useGdal
parameter set to true:
nix-shell -p 'python3.withPackages (ps: [ (ps.django.override { withGdal = true; }) ps.ipython])' --command ipython
Python 3.7.5 (default, Oct 14 2019, 23:08:55)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.6.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import django.contrib.gis.gdal
In [2]:
If you do the same without the override, the import will fail.
The override is available for all supported django versions.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
I've eventually found a workaround by adding
GDAL_LIBRARY_PATH = "/run/current-system/sw/lib/libgdal.so"
GEOS_LIBRARY_PATH = "/run/current-system/sw/lib/libgeos_c.so"
to settings.py and creating an entire container,but it feels like a workaround and even with the above override still does not work without the above workaround
@lsix to be clear without the above workaoround it won't work,even with the override,hence why I've left this issue open.
I marked this as stale due to inactivity. → More info
Still needs the workaround.
I marked this as stale due to inactivity. → More info
Nope,still needed
I marked this as stale due to inactivity. → More info
This issue still persist
I can confirm this; workaround is still needed.
If the override does not function then the patch needs to be fixed.
For deployment in Railways i just went to Dockerfile road. Solve the gdal issue for geodjango application
Hi,
Sorry I only see this issue now. I hope that my answer is not too late and can still be usefull.
In nixpkgs, django's gdal support is optional in order to limit the closure size when using django.
To use gdal support, you need to override django (locally or globally) and use the
useGdal
parameter set to true:nix-shell -p 'python3.withPackages (ps: [ (ps.django.override { withGdal = true; }) ps.ipython])' --command ipython Python 3.7.5 (default, Oct 14 2019, 23:08:55) Type 'copyright', 'credits' or 'license' for more information IPython 7.6.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: import django.contrib.gis.gdal In [2]:
If you do the same without the override, the import will fail.
The override is available for all supported django versions.
Thank
Could this be documented somewhere?
Issue description
I have a django project which uses the gis contribution module.
Steps to reproduce
django-admin startproject test
python ./manage.py check
Technical details
"x86_64-linux"
Linux 5.1.15, NixOS, 19.09pre184359.73392e79aa6 (Loris)
yes
yes
nix-env (Nix) 2.2.2
"nixos-19.09pre184820.aa2a7e49b82"
/nix/var/nix/profiles/per-user/root/channels/nixos