Closed vherasme closed 9 years ago
How do you install pygeoip
and how do you run your code?
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
I'm not too familiar with IPython and you might already have solved this.
You will need to install pygeoip, and you'll have to do the command: pip install pygeoip
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.
Notice this in your old code (extra 'p'):
gip = pygeopip.GeoIP('GeoLiteCity.dat')
hha, my falut. So careless. Both of method are ok.
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)