Photutils has the following strict requirements:
Photutils also optionally depends on other packages for some features:
Scipy 0.19 or later: To power a variety of features in several modules (strongly recommended).
matplotlib 2.2 or later: To power a variety of plotting features (e.g., plotting apertures).
Photutils depends on pytest-astropy (0.4 or later) to run the test suite.
Installing the latest released version¶
To install Photutils with pip, run:
pip install photutils
If you want to make sure that none of your existing dependencies get upgraded, instead you can do:
pip install photutils --no-deps
Note that you may need a C compiler (e.g.,
clang) to be
installed for the installation to succeed.
If you get a
PermissionError, this means that you do not have the
required administrative access to install new packages to your Python
installation. In this case you may consider using the
option to install the package into your home directory. You can read
more about how to do this in the pip documentation.
Do not install Photutils or other third-party packages using
sudo unless you are fully aware of the risks.
Installing the latest development version from Source¶
You will need Cython (0.28 or later), a compiler suite, and the development headers for Python and Numpy in order to build Photutils from the source distribution. On Linux, using the package manager for your distribution will usually be the easiest route.
On MacOS X you will need the XCode command-line tools, which can be installed using:
Follow the onscreen instructions to install the command-line tools required. Note that you do not need to install the full XCode distribution (assuming you are using MacOS X 10.9 or later).
Building and installing manually¶
Photutils is being developed on github. The latest development version of the Photutils source code can be retrieved using git:
git clone https://github.com/astropy/photutils.git
Then to build and install Photutils, run:
cd photutils pip install .[all]
If you wish to install the package in “editable” mode, instead include the “-e” option:
pip install -e .[all]
Building and installing using pip¶
pip install git+https://github.com/astropy/photutils.git
Again, if you want to make sure that none of your existing dependencies get upgraded, instead you can do:
pip install git+https://github.com/astropy/photutils.git --no-deps
Testing an installed Photutils¶
The easiest way to test your installed version of Photutils is running
correctly is to use the
>>> import photutils >>> photutils.test()
Note that this may not work if you start Python from within the Photutils source distribution directory.
The tests should run and report any failures, which you can report to the Photutils issue tracker.