Installation¶
The easiest methods for installing pyproj are:
Use pip to install the binary wheels on PyPI:
pip install pyprojNote
pyproj 3+ no longer supports manylinux1 wheels. pip>=19.0 is required to install manylinux2010 wheels.
Note
pyproj 3+ wheels do not include transformation grids. For migration assistance see: Transformation Grids
The MacOS and Linux wheels are powered by multibuild by Matthew Brett
The Windows wheels are built by Christoph Gohlke
Use conda with the conda-forge channel:
conda install -c conda-forge pyproj
pypoj is maintaned by the pyproj-feedstock maintainers
PROJ is maintaned by the proj.4-feedstock maintainers
If these installation methods do not meet your needs, the section below provides further instructions for getting setup.
Transformation Grids¶
See: Transformation Grids
Installing from source¶
Setup PROJ¶
Version compatibility matrix:
pyproj |
PROJ |
|---|---|
<= 1.9.6 |
<= 5.2 |
2.0-2.1 |
6.0+ |
2.2-2.3 |
6.1-7 |
2.4-2.6 |
6.2-7 |
3+ |
7.2+ |
PROJ is required when building from source. You can download PROJ from https://download.osgeo.org/proj or from https://github.com/OSGeo/PROJ. Installation instructions can be found at https://proj.org/.
In the setup.py, the order for searching for PROJ is:
The PROJ_DIR environment variable
The internal PROJ directory (pyproj/proj_dir)
The proj executable in sys.prefix
The proj executable on the PATH.
For best results, set the PROJ_DIR environment variable to point to location of PROJ installation before running setup.py.
Examples of how to set the PROJ_DIR environment variable:
Windows:
set PROJ_DIR=C:\OSGeo4W\
Linux:
export PROJ_DIR=/usr/local
If you have a previous version of PROJ installed alongside the current version of PROJ, the best way to avoid conflicts is to:
Remove the previous PROJ from PATH & unset old PROJ_LIB environment variable (temporarily)
Install PROJ to the internal PROJ directory (pyproj/proj_dir)
Set the environment variable PROJ_DIR to point to the internal PROJ directory
Set the environment variable PROJ_WHEEL=true
Build pyproj
Setup pyproj¶
The data directory¶
The order of preference for the data directory is:
The one set by pyproj.datadir.set_data_dir (if exists & valid)
The internal proj directory (if exists & valid)
The directory in PROJ_LIB (if exists & valid)
The directory on sys.prefix (if exists & valid)
The directory on the PATH (if exists & valid)
Install pyproj¶
Note
Cython or pip>=10.0.1 is required for the installation.
Note
You may need to run pip with administrative privileges (e.g. sudo pip) or perform a user only installation (e.g. pip install –user).
From pypi:¶
pip install pyproj --no-binary pyproj
From GitHub with pip:¶
pip install git+https://github.com/pyproj4/pyproj.git
From cloned GitHub repo for development:¶
pip install -e .