Installation

Stable version

Installing the latest stable version is possible either using pip or conda.

Using pip

To install pyregion with pip from PyPI simply run:

pip install pyregion

Using conda

To install regions with Anaconda from the conda-forge channel on anaconda.org simply run:

conda install -c conda-forge pyregion

Testing installation

To check if your install is OK, install the test dependencies and run the tests:

pip install "pyregion[test]"
pytest --pyargs pyregion

Development version

Install the latest development version from https://github.com/astropy/pyregion :

git clone https://github.com/astropy/pyregion
cd pyregion
pip install -e .[test]
pytest
cd docs
make html

Dependencies

Python 3.7+ is supported.

pyregion has the following required dependencies:

  • Astropy version 4.0 or later (which requires Numpy)

  • pyparsing version 2.0 or later for parsing the DS9 region files

pyregion has the following optional dependencies for plotting:

To work with the development version, you’ll need a C compiler, because the code to generate masks from regions is written in Cython.