Installation¶
The easiest methods for installing pyproj are:
Use pip to install the binary wheels from PyPI:
python -m pip install pyprojNote
Linux (manylinux2014) wheels require pip 19.3+
Note
pyproj 3+ wheels do not include transformation grids. For migration assistance see: Transformation Grids
The MacOS and Linux wheels are powered by cibuildwheel & multibuild
The Windows wheels versions <= 3.3.x were built by Christoph Gohlke
Use conda with the conda-forge channel:
conda config --prepend channels conda-forge conda config --set channel_priority strict conda create -n pyproj_env pyproj conda activate pyproj_envNote
“… we recommend always installing your packages inside a new environment instead of the base environment from anaconda/miniconda. Using envs make it easier to debug problems with packages and ensure the stability of your root env.” – https://conda-forge.org/docs/user/tipsandtricks.html
Warning
Avoid using pip install with a conda environment. If you encounter a python package that isn’t in conda-forge, consider submitting a recipe: https://github.com/conda-forge/staged-recipes/
pyproj is maintained by the pyproj-feedstock maintainers
PROJ is maintained by the proj.4-feedstock maintainers
If these installation methods do not meet your needs, the section below provides further instructions for getting setup.
Install nightly wheels from anaconda:
python -m pip install pyproj --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
Transformation Grids¶
See: Transformation Grids
Installing from source¶
Version compatibility matrix:
pyproj |
PROJ |
---|---|
<= 1.9.6 |
<= 5.2 |
2.0-2.1 |
6.0-7 |
2.2-2.3 |
6.1-7 |
2.4-2.6 |
6.2-7 |
3.0.0 |
7.2 |
3.0.1-3.2 |
7.2-9.1 |
3.3 |
8.0-9.1 |
3.4+ |
8.2+ |
3.5+ |
9+ |
3.7+ |
9.2+ |
Setup PROJ¶
PROJ is required when building from source.
PROJ Installation Instructions
You can also download PROJ from:
pyproj Build Environment Variables¶
- PROJ_VERSION¶
Added in version 3.0.
This sets the version of PROJ when building pyproj. This enables installing pyproj when the PROJ executables are not present but the header files exist.
- PROJ_DIR¶
This is the path to the base directory for PROJ. Examples of how to set the PROJ_DIR environment variable:
Windows:
set PROJ_DIR=C:\OSGeo4W\
Linux:
export PROJ_DIR=/usr/local
- PROJ_LIBDIR¶
This is the path to the directory containing the PROJ libraries. If not set, it searches the lib and lib64 directories inside the PROJ directory.
- PROJ_INCDIR¶
This is the path to the PROJ include directory. If not set, it assumes it is the includes directory inside the PROJ directory.
- PROJ_WHEEL¶
This is a boolean value used when building a wheel. When true it includes the contents of the pyproj/proj_dir/proj/share directory if present.
- PYPROJ_FULL_COVERAGE¶
Boolean that sets the compiler directive for cython to include the test coverage.
Setup pyproj¶
In the setup.py, the order for searching for PROJ is:
The
PROJ_DIR
environment variableThe 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.
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 the PROJ_DATA` (PROJ 9.1+) | PROJ_LIB (PROJ<9.1) environment variables (temporarily)
Install PROJ to the internal PROJ directory (pyproj/proj_dir)
Set the environment variable
PROJ_DIR
to point to the internal PROJ directorySet the environment variable
PROJ_WHEEL
to trueBuild pyproj
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 .