For future reference, make sure you are using 32-bit versions of Python and OSGeo4Win. GDAL doesn't seem to work otherwise.
On Thursday, June 13, 2019 at 12:45:32 PM UTC-7, RyuCoder wrote:
-- On Thursday, June 13, 2019 at 12:45:32 PM UTC-7, RyuCoder wrote:
Hey,I had a similar issue with one of the projects I was working on.
GDAL was not working properly in windows 10, it was not getting detected for some reason.
I never figured out why and how to fix that.I ended up using Ubuntu to fix the issue. It worked like a charm!On Thu, Jun 13, 2019 at 11:54 PM Thanasis <th.cho...@gmail.com> wrote:--Hello.I want to use the GeoDjango application. I begun with the tutorial GIS Tutorial. I installed properly the PostgreSQL and PostGis for Windows 10. In addition, I follow the steps and I installed the OSGeo4W in order to get the geospartial libraries. I foolowed the steps in order to create the environment variablesGDA L_DATA
andPROJ_LIB. So, I continued with the tutorial https://docs.djangoproject.
com/en/2.2/ref/contrib/gis/ which this command works properly. I make a geographic model and try to make a migration in the database. Although, I get a big tracebacktutorial/#use-ogrinfo-to- examine-spatial-data
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv )
File "C:\Users\examples\vent\lib\site-packages\django\core\ , line 381, in execute_from_command_linemanagement\__init__.py"
utility.execute()
File "C:\Users\examples\vent\lib\site-packages\django\core\ , line 357, in executemanagement\__init__.py"
django.setup()
File "C:\Users\examples\vent\lib\site-packages\django\__init__. , line 24, in setuppy"
apps.populate(settings.INSTALLED_APPS )
File "C:\Users\examples\vent\lib\site-packages\django\apps\ , line 122, in populateregistry.py"
app_config.ready()
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 24, in readyadmin\apps.py"
self.module.autodiscover()
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 26, in autodiscoveradmin\__init__.py"
autodiscover_modules('admin', register_to=site)
File "C:\Users\examples\vent\lib\site-packages\django\utils\ , line 47, in autodiscover_modulesmodule_loading.py"
import_module('%s.%s' % (app_config.name, module_to_search))
File "C:\Users\examples\vent\lib\importlib\__init__.py" , line 127, in import_module
return _bootstrap._gcd_import(name[level :], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>" , line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 5, in <module>gis\admin\__init__.py"
from django.contrib.gis.admin.options import GeoModelAdmin, OSMGeoAdmin
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 2, in <module>gis\admin\options.py"
from django.contrib.gis.admin.widgets import OpenLayersWidget
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 3, in <module>gis\admin\widgets.py"
from django.contrib.gis.gdal import GDALException
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 28, in <module>gis\gdal\__init__.py"
from django.contrib.gis.gdal.datasource import DataSource
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 39, in <module>gis\gdal\datasource.py"
from django.contrib.gis.gdal.driver import Driver
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 5, in <module>gis\gdal\driver.py"
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 9, in <module>gis\gdal\prototypes\ds.py"
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
File "C:\Users\examples\vent\lib\site-packages\django\contrib\ , line 47, in <module>gis\gdal\libgdal.py"
lgdal = CDLL(lib_path)
File "c:\program files (x86)\python37-32\Lib\ctypes\__init__.py" , line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 applicationEnter code here...
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com .
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b30c87ac- .00d0-4966-a43a-c60533ccec49% 40googlegroups.com
For more options, visit https://groups.google.com/d/optout .
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0bacf8a2-2f6c-4217-ae7f-0eda4dcc51bc%40googlegroups.com.
No comments:
Post a Comment