2. Installation of astroML¶
The astroML project is split into two components. The core
written in python only, and is designed to be very easy to install for
any users, even those who don’t have a working C or fortran compiler.
2.2.1. Python Package Index¶
The easiest way to install astroML is to use the Python Package Index
command. First make sure the dependencies
are fulfilled: lacking some of these may not affect installation, but it
will affect the ability to execute code and examples. Next, use the
command to install the packages:
pip install astroML
(For information about
pip, see http://pypi.python.org/pypi/pip)
The first package is python-only, and should install easily on any system.
AstroML is also available as a conda package via the conda-forge or astropy channels. To install with conda, use the following command:
conda install -c astropy astroML
2.2.3. From Source¶
To install the latest version from source, we recommend downloading astroML from the github repository shown above. You must first make sure the dependencies are filled: lacking some of these dependencies will not affect installation, but will affect the ability to execute the code and examples
The astroML package is installed using python’s distutils. The generic commands for installation are as follows:
python setup.py build python setup.py install
The default install location is in your
dist_packages directory in your default python path.
If you are on a machine without write access to the default installation location, the location can be specified when installing. For example, you can specify an arbitrary directory for installation using:
python setup.py install --prefix='/some/path'
There are two levels of dependencies in astroML. Core dependencies are
required for the core
astroML package. Optional dependencies are
required to run some (but not all) of the example scripts. Individual
example scripts will list their optional dependencies at the top of the
2.3.1. Core Dependencies¶
astroML package requires the following:
Python version 3.6+
Numpy >= 1.13
Scipy >= 0.18
scikit-learn >= 0.18
matplotlib >= 3.0
astropy >= 3.0
To run unit tests, you will also need pytest.
2.3.2. Optional Dependencies¶
Several of the example scripts require specialized or upgraded packages. These requirements are listed at the top of the example scripts.