Skip to main content
formatting
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

84

I have found the following to work for windowsWindows:

Run pythonPython to check if your pythonPython is 32 or 64 bit. 
Install corresponding OSGeo4W (32 or 64 bit) into C:\OSGeo4W or C:\OSGeo4W64: 
Note: Select Express Web-GIS Install and click next. 
In the ‘Select Packages’ list, ensure that GDAL is selected; MapServer and Apache are also enabled by default, may be unchecked safely. 
Make sure the following is included in your settings.pysettings.py:

import os
if os.name == 'nt':
    import platform
    OSGEO4W = r"C:\OSGeo4W"
    if '64' in platform.architecture()[0]:
        OSGEO4W += "64"
    assert os.path.isdir(OSGEO4W), "Directory does not exist: " + OSGEO4W
    os.environ['OSGEO4W_ROOT'] = OSGEO4W
    os.environ['GDAL_DATA'] = OSGEO4W + r"\share\gdal"
    os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj"
    os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH']

import os if os.name == 'nt': import platform OSGEO4W = r"C:\OSGeo4W" if '64' in platform.architecture()[0]: OSGEO4W += "64" assert os.path.isdir(OSGEO4W), "Directory does not exist: " + OSGEO4W os.environ['OSGEO4W_ROOT'] = OSGEO4W os.environ['GDAL_DATA'] = OSGEO4W + r"\share\gdal" os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj" os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH'] Run python manage.pyRun python manage.py check to verify geodjango is working correctly.

84

I have found the following to work for windows:

Run python to check if your python is 32 or 64 bit. Install corresponding OSGeo4W (32 or 64 bit) into C:\OSGeo4W or C:\OSGeo4W64: Note: Select Express Web-GIS Install and click next. In the ‘Select Packages’ list, ensure that GDAL is selected; MapServer and Apache are also enabled by default, may be unchecked safely. Make sure the following is included in your settings.py:

import os if os.name == 'nt': import platform OSGEO4W = r"C:\OSGeo4W" if '64' in platform.architecture()[0]: OSGEO4W += "64" assert os.path.isdir(OSGEO4W), "Directory does not exist: " + OSGEO4W os.environ['OSGEO4W_ROOT'] = OSGEO4W os.environ['GDAL_DATA'] = OSGEO4W + r"\share\gdal" os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj" os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH'] Run python manage.py check to verify geodjango is working correctly.

I have found the following to work for Windows:

Run Python to check if your Python is 32 or 64 bit. 
Install corresponding OSGeo4W (32 or 64 bit) into C:\OSGeo4W or C:\OSGeo4W64: 
Note: Select Express Web-GIS Install and click next. 
In the ‘Select Packages’ list, ensure that GDAL is selected; MapServer and Apache are also enabled by default, may be unchecked safely. 
Make sure the following is included in your settings.py:

import os
if os.name == 'nt':
    import platform
    OSGEO4W = r"C:\OSGeo4W"
    if '64' in platform.architecture()[0]:
        OSGEO4W += "64"
    assert os.path.isdir(OSGEO4W), "Directory does not exist: " + OSGEO4W
    os.environ['OSGEO4W_ROOT'] = OSGEO4W
    os.environ['GDAL_DATA'] = OSGEO4W + r"\share\gdal"
    os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj"
    os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH']

Run python manage.py check to verify geodjango is working correctly.

Source Link

84

I have found the following to work for windows:

Run python to check if your python is 32 or 64 bit. Install corresponding OSGeo4W (32 or 64 bit) into C:\OSGeo4W or C:\OSGeo4W64: Note: Select Express Web-GIS Install and click next. In the ‘Select Packages’ list, ensure that GDAL is selected; MapServer and Apache are also enabled by default, may be unchecked safely. Make sure the following is included in your settings.py:

import os if os.name == 'nt': import platform OSGEO4W = r"C:\OSGeo4W" if '64' in platform.architecture()[0]: OSGEO4W += "64" assert os.path.isdir(OSGEO4W), "Directory does not exist: " + OSGEO4W os.environ['OSGEO4W_ROOT'] = OSGEO4W os.environ['GDAL_DATA'] = OSGEO4W + r"\share\gdal" os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj" os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH'] Run python manage.py check to verify geodjango is working correctly.