How to Install geopy in Python
Python Geocoding Toolbox
pip install geopy
What is geopy?
Python Geocoding Toolbox
geopy is a Python client for several popular geocoding web services.
geopy makes it easy for Python developers to locate the coordinates of addresses, cities, countries, and landmarks across the globe using third-party geocoders and other data sources.
geopy includes geocoder classes for the , , and many other geocoding services. The full list is available on the . Geocoder classes are located in .
Quick Start
Minimal example to get started with geopy:
import geopy
print(geopy.__version__)
Installation
pip (standard)
pip install geopy
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install geopy
pip3
pip3 install geopy
conda
conda install -c conda-forge geopy
Poetry
poetry add geopy
Dependencies
Installing geopy will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import geopy; print(geopy.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing geopy with pip.
ModuleNotFoundError: No module named 'geopy'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install geopy. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'geopy' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install geopy to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'geopy'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show geopy and upgrade with pip install --upgrade geopy.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install geopy. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user geopy
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org geopy
MemoryError when loading data
Cause: Dataset is too large to fit in RAM.
Fix: Read in chunks, filter columns on load, or consider Polars/Dask for out-of-core processing.
Recent Releases
| Version | Released |
|---|---|
2.4.1 latest |
2023-11-23 |
2.4.0 |
2023-08-27 |
2.3.0 |
2022-11-13 |
2.2.0 |
2021-07-11 |
2.1.0 |
2020-12-27 |
Manage geopy
Upgrade to latest version
pip install --upgrade geopy
Install a specific version
pip install geopy==2.4.1
Uninstall
pip uninstall geopy
Check what is installed
pip show geopy