Instal Geodjango on Windows with MySQL

274 views
Skip to first unread message

urukay

unread,
May 24, 2010, 11:55:17 AM5/24/10
to geodjango
Hi folks,

i need help to install Geodjango on windows xp x64 with MySql server.

I used GeoDjango Installer for Win, but i'm getting this error:
ImportError: Could not find the GEOS library (tried
"libgeos_c-1"). Try setting GEOS_LIBRARY_PATH in your settings.

I'm running Django 1.1.1 with MySql server.

Guess i'm still missing something, but there are only POSTGRESQL
installation tutorials.

Thanks


Radovan

--
You received this message because you are subscribed to the Google Groups "geodjango" group.
To post to this group, send email to geod...@googlegroups.com.
To unsubscribe from this group, send email to geodjango+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/geodjango?hl=en.

urukay

unread,
May 24, 2010, 11:13:22 AM5/24/10
to geodjango

Justin Bronn

unread,
May 29, 2010, 1:37:46 PM5/29/10
to geod...@googlegroups.com
On 5/24/10 10:55 AM, urukay wrote:
> Hi folks,
>
> i need help to install Geodjango on windows xp x64 with MySql server.
>
> I used GeoDjango Installer for Win, but i'm getting this error:
> ImportError: Could not find the GEOS library (tried
> "libgeos_c-1"). Try setting GEOS_LIBRARY_PATH in your settings.
>
> I'm running Django 1.1.1 with MySql server.
>
> Guess i'm still missing something, but there are only POSTGRESQL
> installation tutorials.
>

What you need is a copy of the GEOS DLL. The GeoDjango installer
expects PostGIS, and when it's installed via the Application Stack
Builder it includes a 32-bit version of GEOS that GeoDjango uses as
well. Because PostgreSQL is not 64-bit on windows (coming in 9.0), this
wouldn't work for you.

I did some digging, and found that the Shapely installer includes the
most recent version of GEOS, and for x64 to boot:

http://gispython.org/dist/Shapely-1.2.win-amd64.exe

After installing, you'll have to manually set
`GEOS_LIBRARY_PATH='C:\Python26\DLLs\geos_c.dll')`, in your settings.
To see if it worked, try the following from the Python prompt:

>>> from django.conf import settings
>>> settings.configure(GEOS_LIBRARY_PATH=r'C:\Python26\DLLs\geos_c.dll')
>>> from django.contrib.gis.geos import tests
>>> tests.run()

This worked for me on a XP Pro x64 install. While this will get you
started, more advanced features like LayerMapping still require GDAL,
and I personally do not know where to get x64 windows binaries for that
(if you find out tell me). This means that some features, like
LayerMapping, won't be available -- however, the core of GeoDjango
(spatial models, queries, etc.) will still work and MySQL doesn't
support a lot of those features regardless.

-Justin

Reply all
Reply to author
Forward
0 new messages