分享技术,记录生活,在互联网上留下属于自己的一亩三分地。

IOError: [Errno 2] No such file or directory: ‘GeoIP.dat’提示错误,解决办法:

默认笔记 novadmin 1906℃ 0评论

报错:IOError: [Errno 2] No such file or directory: ‘GeoIP.dat’

[root@li433-14 ssbc-master]# python workers/simdht_worker.py
exceptions must be old-style classes or derived from BaseException, not NoneType
exceptions must be old-style classes or derived from BaseException, not NoneType
Traceback (most recent call last):
File “workers/simdht_worker.py”, line 39, in
import simMetadata
File “/root/ssbc-master/workers/simMetadata.py”, line 11, in
from simdht_worker import entropy
File “/root/ssbc-master/workers/simdht_worker.py”, line 41, in
from metadata import save_metadata
File “/root/ssbc-master/workers/metadata.py”, line 14, in
geoip = pygeoip.GeoIP('GeoIP.dat’)
File “/usr/lib/python2.7/site-packages/pygeoip/__init__.py”, line 75, in __call__
cls._instances[filename] = super(_GeoIPMetaclass, cls).__call__(*args, **kwargs)
File “/usr/lib/python2.7/site-packages/pygeoip/__init__.py”, line 118, in __init__
self._fp = codecs.open(filename, 'rb’, ENCODING)
File “/usr/lib64/python2.7/codecs.py”, line 881, in open
file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 2] No such file or directory: 'GeoIP.dat’

解决办法:
从http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz下载GeoIP包,解压出来GeoIP.dat上传到/root/ssbc-master文件夹即可。

转载请注明:Nov » IOError: [Errno 2] No such file or directory: ‘GeoIP.dat’提示错误,解决办法:

喜欢 (0)or分享 (0)
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址