in python error while importing GeoIP on CentOs server
Question: I am using Django, and when I am using the geoip package or importing GeoIP I
am getting the following error on centos, while it is working well on ubuntu
12.04.

The error is as follows

    
    
     from django.contrib.gis.utils.geoip import GeoIP
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python2.6/site-packages/django/contrib/gis/utils/geoip.py", line 67, in <module>
        'Try setting GEOIP_LIBRARY_PATH in your settings.' % lib_name)
    django.contrib.gis.utils.geoip.GeoIPException: Could not find the GeoIP library (tried "GeoIP"). Try setting GEOIP_LIBRARY_PATH in your settings.
    

please try to help me out, I can't go further without this.


Answer: trying doing this on both of your systems:

    
    
    $ echo $GEOIP_LIBRARY_PATH
    

and compare the output. From the error message, it sounds like you will get a
directory path on Ubuntu, and make sure the same path is set up on CentOS,
like so (on the centOS system):

    
    
    $ export GEOIP_LIBRARY_PATH=$GEOIP_LIBRARY_PATH:<path returned from Ubuntu system>
    

