Tracing an IP address in Python

For a college project for my course on Introduction to Programming, I decided to make a small software that traces the IP address and puts them nicely on a GUI (PyQt). Not a big deal I know, but...

What are the benefits of pip and virtualenv?

So everyone is telling me to use pip and virtualenv but no-one is able to explain me how it is better than my current approach. The main reason for people to use pip and virtualenv seems to be...

PyCurl installed but not found

I've been trying to install pycurl in a virtualenv with easy_install, and it appears to install correctly: (xxx) $ easy_install pycurl Searching for pycurl Reading...

Python: invalid syntax error

Why am I having a 'invalid syntax' error on this script? I'm using the Python 3.3.2 Shell and when I'm trying to run the module there is just an 'invalid syntax' popping up. import os, re,...

GeoIPIPSP.dat Invalid datebase type

we have a commercial maxmind-subscribtion to obtain a GeoIP-Database with ISP-information (GeioIPIPSP.dat). However, when I try to query this file, I keep getting the following error: GeoIPError:...

How to get latitude, longtitude from country, region code using pygeoip

I have GeoIP city and region codes like so: region_code:H9 country_code:GB The city and region codes I have were obtained via GeoIP from IP address at some point in the past. However, IP address...

Intalling from requirements.txt fails

I am trying to install the requirements of an old project and I am hitting a few problems. One of which I can't figure out is this error: Requirement already satisfied (use --upgrade to upgrade):...

Build error on Heroku

I am pushing my Python app to Heroku, it's installing requirements and at the end it crashes. Below is the tail of the log: .... SWIG/_m2crypto_wrap.c:4237: warning: 'saltlen' may be used...

pygeoip vs django.contrib.gis.geoip

I'm building a django powered website and need access to the (rough) location of my users and i soon found the free databases from MaxiMind. But i found two ways of accessing them...

Set PYTHONPATH through shell script

I am using a third party python module in my code and i need to install that module using easy_install in my local/current directory. I have to write a shell script which will export PYTHONPATH...

Python: Structuring a list of code using pygeoip

this will be a very nooby situation that really I just need help structuring certain code. I'm trying to use a geoIP python package to use a list of IPs that will return the location of the IP for...

How to query ASN for a known IP address with GeoIP on Django?

I'm using Django 1.73 on Python 2.7. How can I query the ASN for a known IP address using GeoIP Django? from django.contrib.gis.geoip import GeoIP g = GeoIP() g.city('72.14.207.99') #returns the...

How to get the timezone offset for the known timezone string?

I'm using pygeoip package to get the timezone for an IP, >>> import pygeoip >>> gi = pygeoip.GeoIP('GeoIPCity.dat') >>> gi.time_zone_by_addr('64.233.161.99') 'America/Los_Angeles' Is there any...

Error installing Willie irc bot for Python

Trying to install this Python IRC bot called Willie. This is what happens when I run setup.py: C:\Python34\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition...

Where is the GeoIPOrg.dat file?

I did the following on my Ubuntu sudo pip install pygeoip More here: https://code.google.com/p/pygeoip/wiki/Usage On commandline, import pygeoip works But what is the actual location of this...

'str' object has no attribute 'META' in function when retrieving request.META

These are my functions for country detection using IP. from unipath import Path import pygeoip # Country Detection def get_ip_address(request): x_forwarded_for =...

Violent Python - Having trouble with OptParse outputting the correct information

I am working directly from the Violent Python PDF, page 147. I am currently using the pygeoip module to find the location of IP adresses. I was able to do this first step fairly easily and it is...

Importerror on prawcore using crontab

So I've written my own wallpaper changer using python and praw to pull images down from reddit. It works great when called from the command line. My issue is with crontab. I modified the crontab...

Python Dropbox API Error

I'm getting the error "ImportError: No module named packages.urllib3.poolmanager" when I try to use the "dropbox" package from pip install, and I have listed my pip installed packages here as...

Parsing KML to Google Maps only shows one of hundreds of pins

My Expectations I'm working my way through Violent Python and am currently on a module where I'm grabbing ip-addresses from a .pcap-file, parsing the ip-addresses to longitudes and latitudes and...

Convert python script output to csv

I have a small program that is returning results on the location of some users from a database Yay. I want to those results to each be in their own column in a CSV. How would you structure that so...

Python: Passing a list of IP addresses as a list of strings

My code is designed to geo-locate IP addresses from a text file. I'm having trouble on the last section. When I run the code, I get a complaint from the map_ip.update line: socket.error: illegal...

FileNotFoundError: [Errno 2] No such file or directory: 'media/GeoLite2-City.mmdb'

I have a file in the media/ directory: When I in a test.py file to get it by GeoIP(): from pygeoip import GeoIP def getLatLon(ip): gi = GeoIP('media/GeoLite2-City.mmdb') data =...

I can't import some packages in python

I'm using vscode on Solus OS, Python having trouble importing some packages I'm using pip and anaconda packages. Packages that are not commented are having a problem. I don't have any clue why...

Error in geoip .dat after creating

DISCLAIMER Yes, i know that .dat (geoip v1) legacy is EOL, but i really need it! I need to create binary .dat (GeoLiteCity.dat) file from .csv files. For this i use mmutils (csv2dat.py -w...

FInd the country of an IP using python

I am trying to find the Country of a database of IPs in Python. As a test I tried to find the location of one IP using pygeoip. However my code is not producing any output. The print statement is...

KeyError: 'collectstatic' When deploying the Django application to pythonanywhere

During the implementation of my Django application on pythonanywhere for the first time I encountered such an error. Previous applications with a very similar structure were able to be implemented...

How to fix subprocess."CalledProcessError Command returned non-zero exit status 1" OpenedX?

I'm localizing my OpenedX - Ironwood version. And meet an error when I ran the "paver i18n_generate" command. I've followed the instruction in this link step by step:...

Conflicting with version dependencies when running pip install

Having issues with version dependencies when running pip install on docker. However, when installing on my mac without docker and just virtualenv, works perfectly fine. These are the versions I...

DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools-scm')

Hello when trying to deploy a django application to elastic beanstalk this error shows up, DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools-scm') I have...