appliedsec / pygeoip

DEPRECATED: Pure Python API for Maxmind's binary GeoIP databases
https://github.com/appliedsec/pygeoip
GNU Lesser General Public License v3.0
482 stars 111 forks source link

ImportError: No module named 'pygeoip' #65

Closed vherasme closed 9 years ago

vherasme commented 10 years ago

Hi,

I am using python 3.4.1 and I am trying to load this module in order to use it with pandas. I am receiving the follwoing error:

ImportError Traceback (most recent call last)

in () ----> 1 import pygeoip 2 gi = pygeoip.GeoIP('./GeoLiteCity.dat', pygeoip.MEMORY_CACHE) ImportError: No module named 'pygeoip'
tiwilliam commented 10 years ago

How do you install pygeoip and how do you run your code?

vherasme commented 10 years ago

Hi,

I copied the files to 'C:\python34' and there I run: python setup.py install. Then in an Ipython notebook I run import pygeoip and I get the error message errorpygeoip

tiwilliam commented 9 years ago

I'm not too familiar with IPython and you might already have solved this.

Wangjiye commented 8 years ago

You will need to install pygeoip, and you'll have to do the command: pip install pygeoip

cell13 commented 7 years ago

I meet the same problem after i installed the pygeoip using the command "pip install pygeoip". the old code: import pygeoip gip = pygeopip.GeoIP('GeoLiteCity.dat') rec = gip.record_by_addr(raw_input("input the IP of you want:")) print rec ee, there is something wrong, the error message is "NameError: name 'pygeopip' is not defined". You know, there is another way to use the method of module. So let's have a try the below code. the new code: from pygeoip import * gip = GeoIP('GeoLiteCity.dat') rec = gip.record_by_addr(raw_input("input the IP of you want:")) print rec YES! Here is no error again. A good day, thanks.

richarson commented 7 years ago

Notice this in your old code (extra 'p'):

gip = pygeopip.GeoIP('GeoLiteCity.dat')

cell13 commented 7 years ago

hha, my falut. So careless. Both of method are ok.