{"id":24332,"library":"pygeoip","title":"pygeoip","description":"Pure Python GeoIP API for MaxMind databases. Current version 0.3.2, last released in 2017. Unmaintained, no longer recommended. Use geoip2 instead.","status":"deprecated","version":"0.3.2","language":"python","source_language":"en","source_url":"https://github.com/appliedsec/pygeoip","tags":["geoip","geolocation","maxmind","ip-lookup"],"install":[{"cmd":"pip install pygeoip","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Old style from maxminddb or geoip2 confusion","wrong":"from pygeoip import GeoIP (works but not recommended)","symbol":"GeoIP","correct":"import pygeoip\ngeoip = pygeoip.GeoIP('GeoIP.dat')"}],"quickstart":{"code":"import pygeoip\n\ngi = pygeoip.GeoIP('GeoIP.dat', flags=pygeoip.MEMORY_CACHE)\nprint(gi.country_code_by_name('google.com'))  # 'US'","lang":"python","description":"Basic country lookup using a GeoIP database file."},"warnings":[{"fix":"pip install geoip2 and replace with geoip2.database.Reader","message":"pygeoip is unmaintained and will not receive updates for new MaxMind databases. Use geoip2 instead.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Use geoip2 with GeoLite2-Country.mmdb","message":"MaxMind discontinued the legacy GeoIP.dat format starting 2019. The library only supports the legacy format.","severity":"breaking","affected_versions":"all"},{"fix":"Check if address is IPv4 before lookup, or use geoip2.","message":"The library does not support IPv6 addresses. Passing an IPv6 address raises an error.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'import pygeoip' then 'pygeoip.GeoIP' or verify installation.","cause":"Importing pygeoip module incorrectly or using an older version.","error":"AttributeError: module 'pygeoip' has no attribute 'GeoIP'"},{"fix":"Download GeoIP.dat from MaxMind (legacy) and specify correct path.","cause":"The database file is missing or path is wrong.","error":"pygeoip.geoip.GeoIPError: Can't find the GeoIP database file: GeoIP.dat"},{"fix":"Convert IPv6 to IPv4 if possible, or use geoip2 library.","cause":"pygeoip does not support IPv6 addresses.","error":"ValueError: IPv6 addresses not supported"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}