<commit_before>************
Installation
************

Requirements
============

Astropy has the following strict requirements:

- `Python <http://www.python.org/>`_ 2.6, 2.7, 3.1 or 3.2

- `Numpy <http://www.numpy.org/>`_ 1.4 or later

Astropy also depends on other packages for optional features:

- `h5py <http://alfven.org/wp/hdf5-for-python/>`_: To read/write
  :class:`~astropy.table.table.Table` objects from/to HDF5 files

- `scipy <http://www.scipy.org/>`_: To power a variety of features (currently
  mainly cosmology-related functionality)

- `xmllint <http://www.xmlsoft.org/>`_: To validate VOTABLE XML files.

However, note that these only need to be installed if those particular features
are needed. Astropy will import even if these dependencies are not installed.

.. TODO: Link to the planned dependency checker/installer tool.

Installing Astropy
==================

Using `pip`
-----------

To install Astropy with `pip`, simply run::

    pip install astropy

Binary installers
-----------------

No binary installers are available at this time.

Testing Astropy
---------------

The easiest way to test your installed version of astropy is running
correctly is to use the :func:`astropy.test` function::

    import astropy
    astropy.test()

The tests should run and print out any failures, which you can report at
the `Astropy issue tracker <http://github.com/astropy/astropy/issues>`_.


Building from source
====================

Prerequisites
-------------

You will need a compiler suite and the development headers for Python
and Numpy in order to build Astropy.  Using the package manager for
your platform will usually be the easiest route.

The `instructions for building Numpy from source
<http://docs.scipy.org/doc/numpy/user/install.html>`_ are also a good
resource for setting up your environment to build Python packages.

You will also need `Cython <http://cython.org/>`_ installed to build
from source, unless you are installing a numbered release. (The releases
packages have the necessary C files packaged with them, and hence do not
require Cython.)

.. note:: If you are using MacOS X, the easiest way to install a compiler
          suite is to install the MacOS X developer tools (XCode) As of XCode
          4.3, the command-line compilers are no longer installed by default:
          you will need to open the XCode application, go to **Preferences**,
          then **Downloads**, and then under **Components**, click on the
          Install button to the right of **Command Line Tools**.

Obtaining the source packages
-----------------------------

Source packages
^^^^^^^^^^^^^^^

Source tarballs of past releases and the current development branch of
astropy can be downloaded from https://github.com/astropy/astropy/downloads

Development repository
^^^^^^^^^^^^^^^^^^^^^^

The latest development version of Astropy can be cloned from github
using this command::

   git clone git://github.com/astropy/astropy.git

.. note::

   If you wish to participate in the development of Astropy, see
   :ref:`developer-docs`.  This document covers only the basics
   necessary to install Astropy.

Building and Installing
-----------------------

Astropy uses the Python `distutils framework
<http://docs.python.org/install/index.html>`_ for building and
installing and requires the<commit_msg>Clarification to install docs regarding compilers<commit_after>************
Installation
************

Requirements
============

Astropy has the following strict requirements:

- `Python <http://www.python.org/>`_ 2.6, 2.7, 3.1 or 3.2

- `Numpy <http://www.numpy.org/>`_ 1.4 or later

Astropy also depends on other packages for optional features:

- `h5py <http://alfven.org/wp/hdf5-for-python/>`_: To read/write
  :class:`~astropy.table.table.Table` objects from/to HDF5 files

- `scipy <http://www.scipy.org/>`_: To power a variety of features (currently
  mainly cosmology-related functionality)

- `xmllint <http://www.xmlsoft.org/>`_: To validate VOTABLE XML files.

However, note that these only need to be installed if those particular features
are needed. Astropy will import even if these dependencies are not installed.

.. TODO: Link to the planned dependency checker/installer tool.

Installing Astropy
==================

Using `pip`
-----------

To install Astropy with `pip`, simply run::

    pip install astropy

.. note:: that you will need a C compiler (e.g. ``gcc`` or ``clang``) to be
          installed (see `Building from source`_ below) for the installation
          to succeed.

Binary installers
-----------------

No binary installers are available at this time.

Testing Astropy
---------------

The easiest way to test your installed version of astropy is running
correctly is to use the :func:`astropy.test` function::

    import astropy
    astropy.test()

The tests should run and print out any failures, which you can report at
the `Astropy issue tracker <http://github.com/astropy/astropy/issues>`_.


Building from source
====================

Prerequisites
-------------

You will need a compiler suite and the development headers for Python and
Numpy in order to build Astropy. On Linux, using the package manager for your
distribution will usually be the easiest route, while on MacOS X you will
likely need to install XCode (see note below).

The `instructions for building Numpy from source
<http://docs.scipy.org/doc/numpy/user/install.html>`_ are also a good
resource for setting up your environment to build Python packages.

You will also need `Cython <http://cython.org/>`_ installed to build
from source, unless you are installing a numbered release. (The releases
packages have the necessary C files packaged with them, and hence do not
require Cython.)

.. note:: If you are using MacOS X, the easiest way to install a compiler
          suite is to install `XCode <https://developer.apple.com/xcode/>`_.
          As of XCode 4.3, the command-line compilers are no longer installed
          by default: you will need to open the XCode application, go to
          **Preferences**, then **Downloads**, and then under **Components**,
          click on the Install button to the right of **Command Line Tools**.

Obtaining the source packages
-----------------------------

Source packages
^^^^^^^^^^^^^^^

Source tarballs of past releases and the current development branch of
astropy can be downloaded from https://github.com/astropy/astropy/downloads

Development repository
^^^^^^^^^^^^^^^^^^^^^^

The latest development version of Astropy can be cloned from github
using this command::

   git clone git://github.com/astropy/astropy.git

.. note::

   If you wish to participate in the development of Astropy, see
   :ref:`developer-docs`.  This document covers only the basics
   necessary to install Astropy.

Building and Installing
-----------------------

Astropy uses the Python `distutils framework
<http://docs.python.org/install/index.html>`_ for building and
installing and requires the
{'fraction_non_alphanumeric': 0.1333428612262398, 'fraction_numerical': 0.004287551807917679, 'mean_word_length': 3.434727503168568, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 3, 'lorem ipsum': 0, 'www.': 8, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '60371', 'n_tokens_mistral': 1918, 'n_tokens_neox': 1829, 'n_words': 839}