4

Does anybody know how to install GeoIP's C library on Windows in a few simple steps. Even a few complicated steps will do. I researched and tried to compile it from the setup file but failed several times. Sometimes, I get errors saying that GeoIP.h could not be located. Other times I get that bugtrack_url is not a valid option for compilation.

I have tried using pip install GeoIP and I have also tried just using setup.py.

Has anyone had any luck setting this up on Windows?

Sunjay Varma
  • 5,007
  • 6
  • 34
  • 51
  • You can get rid of the `bugtrack_url` complaint by removing that line from the `setup.py` file (which will be in the package under a folder named `build` if pip failed. As for the rest, good luck. – Tom May 08 '14 at 17:56
  • Please read the tag descriptions before you use them. The `windows` tag when used this way. – ChiefTwoPencils Jun 10 '14 at 20:22

1 Answers1

10

The 'GeoIP.h could not be located' error indicates that you need to install libgeoip-dev first. Though I have no idea how to install it on windows easiy.

I suggest you to use the pygeoip package, based on the following reasons:

  • pygeoip is a pure python package
  • pygeoip supports Python 3
  • pygeoip has wheel support
  • pygeoip has better documentation
  • pygeoip has 50x more downloads on pypi.
  • pygeoip is compatible with GeoIP's API
Leonardo.Z
  • 9,425
  • 3
  • 35
  • 38
  • For the legacy GeoIP format, pygeoip is the better API unless you absolutely need the extra speed. It isn't quite compatible with the MaxMind API, but the differences are fairly minor. – Greg Oschwald Mar 11 '14 at 23:25
  • 3
    For the new MaxMind format, [geoip2](https://pypi.python.org/pypi/geoip2) provides both a C extension and pure Python version. – Greg Oschwald Mar 11 '14 at 23:27
  • Thank you! This worked very well. I was trying to use Django's GeoIP implementation, but this was far easier to work with and apply to what I needed. – Sunjay Varma Mar 12 '14 at 04:41