import pyproj
from pyproj import CRS, Transformer
from pyproj.exceptions import CRSError, ProjError
# PROJ version (string and tuple)
print(pyproj.proj_version_str) # e.g. "9.6.0"
print(pyproj.PROJ_VERSION) # (9, 6, 0)
# full diagnostics: pyproj version, PROJ version, data dir, etc.
pyproj.show_versions()
# is a projection/CRS supported? -- just try to build it
def crs_ok(user_input):
try:
CRS.from_user_input(user_input)
return True
except CRSError:
return False
crs_ok("EPSG:3031") # True
crs_ok("+proj=laea +lat_0=-90 +datum=WGS84") # True
crs_ok("+proj=spilhaus") # False
# is a specific +proj method known to this PROJ build?
from pyproj.list import get_proj_operations_map
ops = get_proj_operations_map()
"laea" in ops, "ortho" in ops, "peirce_q" in ops # peirce_q needs PROJ >= 9.4
# can PROJ actually build a transformation between two CRS?
def transform_ok(src, dst):
try:
Transformer.from_crs(src, dst, always_xy=True)
return True
except (CRSError, ProjError):
return False
i.e.
docker run --rm -ti ghcr.io/hypertidy/gdal-r-python
── ghcr.io/hypertidy/gdal-r-python ──
GDAL 3.13.3 PROJ 9.9.0 GEOS 3.15.0
R 4.6.1
Py 3.12.3 numpy 2.5.3 pyarrow 25.0.1 (libarrow 25.0.1)
Docs: https://github.com/hypertidy/gdal-r-ci#gdal-r-python
root@be9bc9ac06ba:/workspace# python
Python 3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyproj
>>> from pyproj import CRS, Transformer
>>> from pyproj.exceptions import CRSError, ProjError
>>>
>>> # PROJ version (string and tuple)
>>> print(pyproj.proj_version_str)
9.9.0
>>> print(pyproj.PROJ_VERSION)
(9, 9, 0)
>>> # full diagnostics: pyproj version, PROJ version, data dir, etc.
>>> pyproj.show_versions()
pyproj info:
pyproj: 3.8.0
PROJ (runtime): 9.9.0
PROJ (compiled): 9.9.0
data dir: /usr/local/share/proj
user_data_dir: /root/.local/share/proj
PROJ DATA (recommended version): 1.25
PROJ Database: 1.7
EPSG Database: v13.102 [2026-08-27]
ESRI Database: ArcGIS Pro 3.6 [2025-12-01]
IGNF Database: 3.1.0 [2019-05-24]
System:
python: 3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]
executable: /opt/gdal-py/bin/python
machine: Linux-6.8.0-138-generic-x86_64-with-glibc2.39
Python deps:
certifi: 2026.7.22
Cython: 3.3.0
setuptools: 84.0.0
pip: 26.2.1
>>>
>>> # is a projection/CRS supported? -- just try to build it
>>> def crs_ok(user_input):
... try:
... CRS.from_user_input(user_input)
... return True
... except CRSError:
... return False
...
crs_ok("EPSG:3031")
#True
crs_ok("+proj=laea +lat_0=-90 +datum=WGS84")
#True
crs_ok("+proj=spilhaus")
#True
transform_ok("EPSG:4326", "+proj=spilhaus +lon_0=147 +lat_0=-42")
#True