How To Install python3-pygeoip on Fedora 36
Introduction
In this tutorial we learn how to install python3-pygeoip
on Fedora 36.
What is python3-pygeoip
Pure Python GeoIP API based on MaxMind’s C-based Python API but the code itself is ported from the Pure PHP GeoIP API. Create your GeoIP instance with appropriate access flag.
STANDARD
reads data from disk when needed,MEMORY_CACHE
loads database into memory on instantiation andMMAP_CACHE
loads database into memory using mmap. import pygeoip gi = pygeoip.GeoIP(’/usr/share/geoip/GeoIP.dat’, pygeoip.MEMORY_CACHE) Country lookup »> gi.country_code_by_name(‘google.com’) ‘US’ »> gi.country_code_by_addr(‘64.233.161.99’) ‘US’ »> gi.country_name_by_addr(‘64.233.161.99’) ‘United States’ City lookup »> gi = pygeoip.GeoIP(’/usr/share/geoip/GeoLiteCity.dat’) »> gi.record_by_addr(‘64.233.161.99’) { ‘city’ ‘region_name’ ‘area_code’ ’longitude’ ‘country_code3’ ’latitude’ ‘postal_code’ ‘dma_code’ ‘country_code’ ‘country_name’ } »> gi.time_zone_by_addr(‘64.233.161.99’) ‘America/Los_Angeles’ For more information, check out the full API documentation at http
We can use yum
or dnf
to install python3-pygeoip
on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install python3-pygeoip.
Install python3-pygeoip on Fedora 36 Using dnf
Update yum database with dnf
using the following command.
sudo dnf makecache --refresh
After updating yum database, We can install python3-pygeoip
using dnf
by running the following command:
sudo dnf -y install python3-pygeoip
Install python3-pygeoip on Fedora 36 Using yum
Update yum database with yum
using the following command.
sudo yum makecache --refresh
After updating yum database, We can install python3-pygeoip
using yum
by running the following command:
sudo yum -y install python3-pygeoip
How To Uninstall python3-pygeoip on Fedora 36
To uninstall only the python3-pygeoip
package we can use the following command:
sudo dnf remove python3-pygeoip
python3-pygeoip Package Contents on Fedora 36
/usr/lib/python3.10/site-packages/pygeoip
/usr/lib/python3.10/site-packages/pygeoip-0.2.6-py3.10.egg-info
/usr/lib/python3.10/site-packages/pygeoip-0.2.6-py3.10.egg-info/PKG-INFO
/usr/lib/python3.10/site-packages/pygeoip-0.2.6-py3.10.egg-info/SOURCES.txt
/usr/lib/python3.10/site-packages/pygeoip-0.2.6-py3.10.egg-info/dependency_links.txt
/usr/lib/python3.10/site-packages/pygeoip-0.2.6-py3.10.egg-info/top_level.txt
/usr/lib/python3.10/site-packages/pygeoip/__init__.py
/usr/lib/python3.10/site-packages/pygeoip/__pycache__
/usr/lib/python3.10/site-packages/pygeoip/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pygeoip/__pycache__/__init__.cpython-310.pyc
/usr/lib/python3.10/site-packages/pygeoip/__pycache__/const.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pygeoip/__pycache__/const.cpython-310.pyc
/usr/lib/python3.10/site-packages/pygeoip/__pycache__/timezone.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pygeoip/__pycache__/timezone.cpython-310.pyc
/usr/lib/python3.10/site-packages/pygeoip/__pycache__/util.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pygeoip/__pycache__/util.cpython-310.pyc
/usr/lib/python3.10/site-packages/pygeoip/const.py
/usr/lib/python3.10/site-packages/pygeoip/timezone.py
/usr/lib/python3.10/site-packages/pygeoip/util.py
/usr/share/doc/python3-pygeoip
/usr/share/doc/python3-pygeoip/COPYING
/usr/share/doc/python3-pygeoip/DEVELOPER
/usr/share/doc/python3-pygeoip/INSTALL
/usr/share/doc/python3-pygeoip/README.md
/usr/share/doc/python3-pygeoip/apidocs
/usr/share/doc/python3-pygeoip/apidocs/html
/usr/share/doc/python3-pygeoip/apidocs/html/api-objects.txt
/usr/share/doc/python3-pygeoip/apidocs/html/class-tree.html
/usr/share/doc/python3-pygeoip/apidocs/html/crarr.png
/usr/share/doc/python3-pygeoip/apidocs/html/epydoc.css
/usr/share/doc/python3-pygeoip/apidocs/html/epydoc.js
/usr/share/doc/python3-pygeoip/apidocs/html/frames.html
/usr/share/doc/python3-pygeoip/apidocs/html/help.html
/usr/share/doc/python3-pygeoip/apidocs/html/identifier-index.html
/usr/share/doc/python3-pygeoip/apidocs/html/index.html
/usr/share/doc/python3-pygeoip/apidocs/html/module-tree.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip-module.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip-pysrc.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.GeoIP-class.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.GeoIPBase-class.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.GeoIPError-class.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.GeoIPMetaclass-class.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.const-module.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.const-pysrc.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.timezone-module.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.timezone-pysrc.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.util-module.html
/usr/share/doc/python3-pygeoip/apidocs/html/pygeoip.util-pysrc.html
/usr/share/doc/python3-pygeoip/apidocs/html/redirect.html
/usr/share/doc/python3-pygeoip/apidocs/html/toc-everything.html
/usr/share/doc/python3-pygeoip/apidocs/html/toc-pygeoip-module.html
/usr/share/doc/python3-pygeoip/apidocs/html/toc-pygeoip.const-module.html
/usr/share/doc/python3-pygeoip/apidocs/html/toc-pygeoip.timezone-module.html
/usr/share/doc/python3-pygeoip/apidocs/html/toc-pygeoip.util-module.html
/usr/share/doc/python3-pygeoip/apidocs/html/toc.html
References
Summary
In this tutorial we learn how to install python3-pygeoip
on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).