Changes between Initial Version and Version 2 of Ticket #30933


Ignore:
Timestamp:
Oct 31, 2019, 7:16:55 AM (5 years ago)
Author:
Nick Pope
Comment:

So as I said on the PR, I do not feel that we should be encouraging users to install 32-bit. It seems like a backward step and I would rather we address making this work for 64-bit. (I will admit that I don't use Windows, but I will endeavour to help where I can.)

So my understanding is that the documentation for installing dependencies for GeoDjango on Windows is at https://docs.djangoproject.com/en/stable/ref/contrib/gis/install/#windows.

The first requirement there is to install Python on Windows by following https://docs.djangoproject.com/en/stable/howto/windows/. Django 2.2 doesn't currently support the recently release 3.8, so let's go with 3.7.5 available from https://www.python.org/downloads/release/python-375/.

I note that the next steps suggests is that Windows users ought to be using PostgreSQL & PostGIS. This seems a bit restrictive as I'm sure the other geospatial database backends will work. But let's run with it. (I note that the documentation here ought to be updated to drop references to 9.x - version 10, 11 and 12 are available, so 9.6 is >3 years old.) Django 2.2 only supports up to 11, so let's go with 11.5, available from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads. I note that EnterpriseDB have stopped providing 32-bit builds for Windows for PostgreSQL >= 11. I will assume at this stage that the instructions for PostGIS are the same or similar to those described.

According to the documentation, we will also need the latest version of psycopg2 from http://www.stickpeople.com/projects/python/win-psycopg/. Unfortunately that page no longer seems to work for me and times out. The Internet Archive Wayback Machine gives this version of the page, but the latest version there is only built for Python 3.6 and is psycopg2 2.6.2 when 2.8.4 is available. I would suggest that this documentation is updated to point to https://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg or, better yet, recommend installing psycopg2-binary from PyPI which wasn't available when this was written."

Next we come to OSGeo4W. The instructions point us to https://trac.osgeo.org/osgeo4w/ and using the 64-bit link we get an installer. I note the following restrictions under the "Notes" heading:

  • "32bit/64bit don't contain the same set of packages/versions ​(compare) (purple is 32 bit only)"
  • "Don't blindly do a full install in Advanced mode. Some components require third party additions that need to be installed manually (see the wiki page of the package). Without the additions the components might renderer the installation unuseable."

So after all of that I would expect that you are using the following installers:

For OSGeo4W I presume that you are using "Express Install" as instructed and not "Advanced mode". I don't know if that could cause any problems. There is also a problem that you have stumbled into that OSGeo4W installs a newer version of GDAL than Django 2.2 officially supports. This does make me wonder whether we'd be better off documenting installation of the actual dependencies of GeoDjango - that is GDAL, GEOS and Proj - although some of those just point back to OSGeo4W :(

We may also be bumping into issues with some packages compiled with MSVC and others with MinGW64. Do you have a specific error message or traceback, by the way?

Based on the above, I've updated this ticket to reflect the need for a wider review of the installation of dependencies for GeoDjango on Windows.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30933

    • Property Keywords geodjango installation windows added
    • Property Needs documentation set
    • Property Triage Stage UnreviewedAccepted
    • Property Summary Users need to be directed to install 32-bit Python for GeoDjangoUpdate installation instructions for GeoDjango dependencies on Windows.
  • Ticket #30933 – Description

    initial v2  
    1 I'm setting GeoDjango up on Windows and discovered that GDAL is (at least currently) incompatible with 64-bit Python. Using 32-bit Python and 32-bit OSGeo4Win, I was finally able to get it working. I suggest this be mentioned in the docs to circumvent future headaches for other users.
     1~~I'm setting GeoDjango up on Windows and discovered that GDAL is (at least currently) incompatible with 64-bit Python. Using 32-bit Python and 32-bit OSGeo4Win, I was finally able to get it working. I suggest this be mentioned in the docs to circumvent future headaches for other users.~~
    22
    3 Pull request:
    4 https://github.com/django/django/pull/11995
     3~~Pull request:
     4https://github.com/django/django/pull/11995~~
     5
     6----
     7
     8The installation instructions for dependencies of !GeoDjango on Windows are outdated.
     9
     10Issues that need to be addressed include:
     11
     12- It seems that there may be some as yet undetermined issue wit 64-bit setups.
     13- Not referencing only 9.x versions of PostgreSQL which are > 3 years old.
     14- Consider referring to other geospatial database backends. Why should Windows users be forced to use PostGIS?
     15- Replace outdated instructions for installation of psycopg2. We have binary wheels now that are more up to date.
     16- Using !OSGeo4W can lead to a newer version of GEOS than is supported by Django with no option to downgrade.
     17  - Consider installing individual dependencies for GDAL, GEOS & Proj.
Back to Top