我無法在django中導入GeoIP。我搜索並測試了這個錯誤兩天,但仍然不知道問題。Python/django:無法導入GeoIP
當然,我安裝了GeoDjango。我在Mac OS 10.8
以下是日誌由Django的測試殼
1>>from django.contrib.gis import geoip
2>>module 'django.contrib.gis.geoip' from '/Library/Python/2.7/site-packages/django/contrib/gis/geoip/init.pyc'>
它的工作原理。即使我能找到的圖書館/ Python的/ 2.7 geoip的類/站點包/ Django的/的contrib/GIS/geoip的/ base.py
3>>> from django.contrib.gis.geoip import geoip Traceback (most recent call last): File "", line 1, in ImportError: cannot import name geoip
我還加django.contrib.gis到setting.py。即使我可以在eclipse快捷方式中找到geoip類。無論如何,我在django shell中測試了一件更多的東西。
from django.contrib.gis.geoip.base import GeoIP
Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.7/site-packages/django/contrib/gis/geoip/base.py", line 6, in from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS File "/Library/Python/2.7/site-packages/django/contrib/gis/geoip/libgeoip.py", line 22, in if lib_path is None: raise GeoIPException('Could not find the GeoIP library (tried "%s"). ' NameError: name 'GeoIPException' is not defined
我缺少什麼?
有什麼方法可以測試我的錯誤嗎?