提交 3092dab9 authored 作者: Rémi Louf's avatar Rémi Louf 提交者: Brandon T. Willard

Update the installation instructions in the documentation

The current installation (and update) instructions are out of date, the update instructions are not giving any useful information, and the developer installation instructions are redudundant with the developer starting guide. I thus removed most of the instructions and replaced them with the instructions that are currently in the README.
上级 37f91b8e
@echo off
rem if ANACONDA_DIR is not defined
if [%ANACONDA_DIR%] == [^%ANACONDA_DIR^%] (
if exist "c:\Anaconda" set ANACONDA_DIR=C:\Anaconda
)
if [%ANACONDA_DIR%] == [^%ANACONDA_DIR^%] (
echo "Anaconda not found. Please install AnacondaCE or set the ANACONDA_DIR environment variable to the location of your Anaconda installation."
goto end
)
if not exist %ANACONDA_DIR% (
echo Anaconda install directory %ANACONDA_DIR% does not exist
goto end)
echo Anaconda found in %ANACONDA_DIR%
echo copying dlls from %ANACONDA_DIR%\MinGW\x86_64-w64-mingw32\lib to %ANACONDA_DIR%\
copy %ANACONDA_DIR%\MinGW\x86_64-w64-mingw32\lib\*.dll %ANACONDA_DIR%
echo done
echo Trying to install aesara
pip install Aesara
echo installed
rem Put a default .aesararc.txt
set AESARARC=%USERPROFILE%\.aesararc.txt
set AESARARC_=%USERPROFILE%\.aesararc_install.txt
echo [global]> %AESARARC_%
echo openmp=False>> %AESARARC_%
echo.>> %AESARARC_%
echo [blas]>> %AESARARC_%
echo ldflags=>> %AESARARC_%
if exist %AESARARC% (
echo A .aesararc.txt config file already exists, so we will not change it.
echo The default version is in %AESARARC_%, we suggest you check it out.
) else (
rename %AESARARC_% .aesararc.txt
)
:end
echo end
...@@ -79,7 +79,6 @@ Community ...@@ -79,7 +79,6 @@ Community
introduction introduction
install install
updating
tutorial/index tutorial/index
extending/index extending/index
dev_start_guide dev_start_guide
......
...@@ -3,14 +3,26 @@ ...@@ -3,14 +3,26 @@
Installing Aesara Installing Aesara
================= =================
Supported platforms: The latest release of Aesara can be installed from Pypi using `pip`:
.. toctree:: .. code-block:: bash
:maxdepth: 1
install_ubuntu pip install aesara
install_macos
install_windows
install_centos6
To update your current installation see :ref:`updating`.
Or via conda-force:
.. code-block:: bash
conda install -c conda-forge aesara
The current development branch of Aesara can be installed from GitHub using `pip`:
.. code-block:: bash
pip install git+https://github.com/aesara-devs/aesara
To use the Numba and JAX backend you will need to install these libraries in addition to Aesara. Please refer to `Numba's installation instructions <https://numba.readthedocs.io/en/stable/user/installing.html>`__ and `JAX's installation instructions <https://github.com/google/jax#installation>`__ respectively.
.. include:: css.inc
.. _install_centos6:
CentOS 6 Installation Instructions
##################################
.. warning::
If you want to install the bleeding-edge or development version of Aesara
from GitHub, please make sure you are reading `the latest version of this
page <http://deeplearning.net/software/aesara_versions/dev/install_centos6.html>`_.
.. |PythonDistRecommended| replace:: The development package (python-dev or python-devel on most Linux distributions) is recommended (see just below)
.. |PlatformCompiler| replace:: ``python-dev``, ``g++`` >= 4.2
.. |CompilerName| replace:: ``g++``
.. include:: install_generic.inc
:start-line: 5
Requirements through System Packages (not recommended)
------------------------------------------------------
.. code-block:: bash
sudo yum install python-devel python-pytest python-setuptools gcc gcc-gfortran gcc-c++ blas-devel lapack-devel atlas-devel
sudo easy_install pip
.. include:: css.inc
.. _install_generic:
Installation
============
Stable Installation
-------------------
With ``conda``
^^^^^^^^^^^^^^
If you use conda, you can directly install aesara.
.. code-block:: bash
conda install aesara
With ``pip``
^^^^^^^^^^^^
aesara
::::::
Install the latest stable version of Aesara with:
.. raw:: html
<div class="highlight"><pre><span class="red">&lt;sudo&gt;</span> pip install <span class="blue">&lt;--user&gt;</span> Aesara[test, doc]</pre></div>
- Any argument between <...> is optional.
- Use :red:`sudo` for a root installation.
- Use :blue:`user` for a user installation without admin rights. It will install Aesara in your local site-packages.
- Use `pip install -r requirements.txt` to install the requirements for testing.
- Use `pip install -r requirements-rtd.txt` install the requirements for generating the documentation.
If you encountered any trouble, head to the :ref:`troubleshooting` page.
Bleeding-Edge Installation (recommended)
----------------------------------------
Install the latest, bleeding-edge, development version of Aesara with:
.. raw:: html
<div class='highlight'><pre><span class="red">&lt;sudo&gt;</span> pip install <span class="blue">&lt;--user&gt;</span> <span class="pink">&lt;--no-deps&gt;</span> git+https://github.com/aesara-devs/aesara.git#egg=aesara</pre></div>
- Any argument between <...> is optional.
- Use :red:`sudo` for a root installation.
- Use :blue:`user` for a user installation without admin rights. It will install Aesara in your local site-packages.
- Use :pink:`no-deps` when you don't want the dependencies of Aesara to be installed through pip. This is important when they have already been installed as system packages.
If you encountered any trouble, head to the :ref:`troubleshooting` page.
Developer Installation
----------------------
Install the developer version of Aesara with:
.. raw:: html
<div class="highlight"><pre>git clone git://github.com/aesara-devs/aesara.git
cd aesara
<span class="red">&lt;sudo&gt;</span> pip install <span class="blue">&lt;--user&gt;</span> <span class="pink">&lt;--no-deps&gt;</span> <span class="green">-e .</span></pre></div>
- Any argument between <...> is optional.
- Use :red:`sudo` for a root installation.
- Use :blue:`user` for a user installation without admin rights. It will install Aesara in your local site-packages.
- Use :pink:`no-deps` when you don't want the dependencies of Aesara to be installed through pip. This is important when they have already been installed as system packages.
- :green:`-e` makes your installation *editable*, i.e., it links it to your
source directory.
If you encountered any trouble, head to the :ref:`troubleshooting` page.
.. include:: css.inc
.. _install_macos:
Mac OS Installation Instructions
################################
There are various ways to install Aesara dependencies on a Mac. Here
we describe the process in detail with Anaconda, Homebrew or MacPorts
but if you did it differently and it worked, please let us know the
details so that we can add alternative instructions.
.. |PythonDistRecommended| replace:: The conda distribution is highly recommended
.. |PlatformCompiler| replace:: ``clang`` (the system version)
.. |CompilerName| replace:: ``Clang``
.. attention::
Aesara officially supports only clang on OS X. This can be installed
by getting XCode from the App Store and running it once to install the
command-line tools.
.. include:: install_generic.inc
:start-line: 5
Requirements through Homebrew (not recommended)
-----------------------------------------------
Install python with homebrew:
.. code-block:: bash
$ brew install python # or python3 if you prefer
This will install pip. Then use pip to install numpy, scipy:
.. code-block:: bash
$ pip install numpy scipy
If you want to use openblas instead of Accelerate, you have to install
numpy and scipy with hombrew:
.. code-block:: bash
$ brew tap homebrew/python
$ brew install numpy --with-openblas
$ brew install scipy --with-openblas
Requirements through MacPorts (not recommended)
-----------------------------------------------
Using `MacPorts <http://www.macports.org/>`__ to install all required
Aesara dependencies is easy, but be aware that it will take a long time
(a few hours) to build and install everything.
- MacPorts requires installing XCode first (which can be found in the
Mac App Store), if you do not have it already.
If you can't install it from the App Store, look in your MacOS X installation
DVD for an old version. Then update your Mac to update XCode.
- Download and install `MacPorts <http://www.macports.org/>`__, then
ensure its package list is up-to-date with ``sudo port selfupdate``.
- Then, in order to install one or more of the required libraries, use
``port install``, e.g. as follows:
.. code-block:: bash
$ sudo port install py27-numpy +atlas py27-scipy +atlas py27-pip
This will install all the required Aesara dependencies. gcc will
be automatically installed (since it is a SciPy dependency), but be
aware that it takes a long time to compile (hours)!
Having NumPy and SciPy linked with ATLAS (an optimized BLAS
implementation) is not mandatory, but recommended if you care about
performance.
- You might have some different versions of gcc, SciPy, NumPy, Python installed
on your system, perhaps via Xcode. It is a good idea to use **either** the
MacPorts version of everything **or** some other set of compatible versions
(e.g. provided by Xcode or Fink). The advantages of MacPorts are the
transparency with which everything can be installed and the fact that
packages are updated quite frequently. The following steps describe how to
make sure you are using the MacPorts version of these packages.
- In order to use the MacPorts version of Python, you will probably
need to explicitly select it with ``sudo port select python python27``. The
reason this is necessary is because you may have an Apple-provided Python
(via, for example, an Xcode installation). After performing this step, you
should check that the symbolic link provided by ``which python`` points to
the MacPorts python. For instance, on MacOS X Lion with MacPorts 2.0.3,
the output of ``which python`` is ``/opt/local/bin/python`` and this symbolic
link points to ``/opt/local/bin/python2.7``. When executing ``sudo
port select python python27-apple`` (which you should **not** do), the link
points to ``/usr/bin/python2.7``.
- Similarly, make sure that you are using the MacPorts-provided gcc:
use ``sudo port select gcc`` to see which gcc installs you have on the
system. Then execute for instance ``sudo port select gcc mp-gcc44``
to create a symlink that points to the correct (MacPorts) gcc (version 4.4
in this case).
- At this point, if you have not done so already, it may be a good idea to
close and restart your terminal, to make sure all configuration changes
are properly taken into account.
- Afterwards, please check that the ``scipy`` module that is imported in
Python is the right one (and is a recent one). For instance, ``import
scipy`` followed by ``print scipy.__version__`` and ``print scipy.__path__``
should result in a version number of at least 0.7.0 and a path that starts
with ``/opt/local`` (the path where MacPorts installs its packages). If this
is not the case, then you might have some old installation of ``scipy`` in your
``PYTHONPATH`` so you should edit ``PYTHONPATH`` accordingly.
- Please follow the same procedure with ``numpy``.
- This is covered in the MacPorts installation process, but make sure that
your ``PATH`` environment variable contains ``/opt/local/bin`` and
``/opt/local/sbin`` before any other paths (to ensure that the Python and
gcc binaries that you installed with MacPorts are visible first).
- MacPorts does not automatically create ``pip`` symlinks pointing to the
MacPorts version; you can add them yourself with
.. code-block:: bash
$ sudo ln -s /opt/local/bin/pip-2.7 /opt/local/bin/pip
.. include:: css.inc
.. _install_ubuntu:
Ubuntu Installation Instructions
################################
.. warning::
If you want to install the bleeding-edge or development version of Aesara
from GitHub, please make sure you are reading `the latest version of this
page <http://deeplearning.net/software/aesara_versions/dev/install_ubuntu.html>`_.
.. |PythonDistRecommended| replace:: The development package (python-dev or python-devel on most Linux distributions) is recommended (see just below)
.. |PlatformCompiler| replace:: ``python-dev``, ``g++`` >= 4.2
.. |CompilerName| replace:: ``g++``
.. include:: install_generic.inc
:start-line: 5
Prerequisites through System Packages (not recommended)
-------------------------------------------------------
If you want to acquire the requirements through your system packages
and install them system wide follow these instructions:
For Ubuntu 16.04
.. code-block:: bash
sudo apt-get install python-numpy python-scipy python-dev python-pip python-pytest g++ libopenblas-dev git graphviz
sudo pip install Aesara
sudo apt-get install g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
For Ubuntu 11.10 through 14.04:
.. code-block:: bash
sudo apt-get install python-numpy python-scipy python-dev python-pip python-pytest g++ libopenblas-dev git
On 14.04, this will install Python 2 by default. If you want to use Python 3:
.. code-block:: bash
sudo apt-get install python3-numpy python3-scipy python3-dev python3-pip python3-pytest g++ libopenblas-dev git
sudo pip3 install Aesara
For Ubuntu 11.04:
.. code-block:: bash
sudo apt-get install python-numpy python-scipy python-dev python-pip python-pytest g++ git libatlas3gf-base libatlas-dev
Manual Openblas installation (deprecated)
-----------------------------------------
The openblas included in some older Ubuntu version is limited to 2
threads. Ubuntu 14.04 do not have this limit. If you want to use more
cores at the same time, you will need to compile it yourself. Here is
some code that will help you.
.. code-block:: bash
# remove openblas if you installed it
sudo apt-get remove libopenblas-base
# Download the development version of OpenBLAS
git clone git://github.com/xianyi/OpenBLAS
cd OpenBLAS
make FC=gfortran
sudo make PREFIX=/usr/local/ install
# Tell Aesara to use OpenBLAS.
# This works only for the current user.
# Each Aesara user on that computer should run that line.
echo -e "\n[blas]\nldflags = -lopenblas\n" >> ~/.aesararc
.. include:: css.inc
.. _install_windows:
Windows Installation Instructions
#################################
.. warning::
If you want to install the bleeding-edge or development version of Aesara
from GitHub, please make sure you are reading `the latest version of this
page <http://deeplearning.net/software/aesara_versions/dev/install_windows.html>`_.
.. |PythonDistRecommended| replace:: The conda distribution is highly recommended
.. |PlatformCompiler| replace:: GCC compiler with ``g++`` (version >= ``4.2.*``), and Python development files
.. |CompilerName| replace:: ``g++``
Install requirements and optional packages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
conda install numpy scipy mkl-service libpython <m2w64-toolchain> pytest <sphinx> <pydot-ng> <git>
.. note::
* Arguments between <...> are optional.
* ``m2w64-toolchain`` package provides a fully-compatible version of GCC and is then highly recommended.
* ``git`` package installs git source control through conda, which is required for the development version of Aesara
.. Installation of Aesara.
.. include:: install_generic.inc
:start-after: .. _install_generic:
Instructions for other Python distributions (not recommended)
=============================================================
If you plan to use Aesara with other Python distributions, these are
generic guidelines to get a working environment:
* Look for the mandatory requirements in the package manager's repositories of your distribution. Many
distributions come with ``pip`` package manager which use `PyPI repository <https://pypi.python.org/pypi>`__.
The required modules are Python (of course), NumPy, SciPy and a BLAS implementation (MKL or OpenBLAS).
Use the versions recommended at the top of this documentation.
* If the package manager provide a GCC compiler with the recommended version (see at top), install it. If not,
you could use the build `TDM GCC <http://tdm-gcc.tdragon.net/>`_ which is provided for both 32- and 64-bit
platforms. A few caveats to watch for during installation:
1. Install to a directory without spaces (we have placed it in
``C:\SciSoft\TDM-GCC-64``)
2. If you don't want to clutter your system PATH un-check ``add to
path`` option.
3. Enable OpenMP support by checking the option ``openmp support
option``.
.. include:: css.inc
.. _updating:
Updating Aesara
===============
Follow one of these three sections depending on how you installed Aesara.
You should update frequently, bugs are fixed on a very regular basis, and features are
added even more frequently!
Stable Installation
-------------------
The following command will update only Aesara:
.. raw:: html
<pre><span class="red">&#60;sudo&#62;</span> pip install <span class="blue">&#60;--user&#62;</span> <span class="pink">&#60;--no-deps&#62;</span> aesara</pre>
- Use :red:`sudo` for a root installation.
- Use :blue:`user` for a user installation without admin rights. It will install Aesara in your local site-packages.
- Use :pink:`no-deps` when you don't want the dependencies of Aesara to not be installed through pip. This is important when they have already been installed as system packages.
.. warning::
If you installed NumPy/SciPy with yum/apt-get, updating NumPy/SciPy
with pip/easy_install is not always a good idea. This can make Aesara
crash due to problems with BLAS. The versions of
NumPy/SciPy in the distribution are sometimes linked against faster
versions of BLAS. Installing NumPy/SciPy with
yum/apt-get/pip/easy_install won't install the development package
needed to recompile it with the fast version.
To fix a possible crash, you can clear
the Aesara cache like this:
.. code-block:: bash
aesara-cache clear
Bleeding-Edge Installation
--------------------------
The following command will update your bleeding-edge version of Aesara
.. raw:: html
<div style="width:100%"><pre><span class="red">&#60;sudo&#62;</span> pip install <span class="blue">&#60;--user&#62;</span> <span class="pink">&#60;--no-deps&#62;</span> git+https://github.com/aesara-devs/aesara.git#egg=Aesara</pre></div>
- Use :red:`sudo` for a root installation.
- Use :blue:`user` for a user installation without admin rights. It will install Aesara in your local site-packages.
- Use :pink:`no-deps` when you don't want the dependencies of Aesara to not be installed through pip. This is important when they have already been installed as system packages.
.. warning::
If you installed NumPy/SciPy with yum/apt-get, updating NumPy/SciPy
with pip/easy_install is not always a good idea. This can make Aesara
crash due to problems with BLAS. The versions of
NumPy/SciPy in the distribution are sometimes linked against faster
versions of BLAS. Installing NumPy/SciPy with
yum/apt-get/pip/easy_install won't install the development package
needed to recompile it with the fast version.
To fix a possible crash, you can clear
the Aesara cache like this:
.. code-block:: bash
aesara-cache clear
Developer Installation
----------------------
To update your library to the latest revision, change directory (``cd``)
to your ``Aesara`` folder and execute the following command:
.. warning::
The following assumes you have knowledge of git and know how to do a rebase.
.. code-block:: bash
git pull --rebase
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论