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.
Requirements¶
Note
We only support the installation of the requirements through conda.
- Python == >= 3.7
- The conda distribution is highly recommended. Python 2.4 was supported up to and including the release 0.6. Python 2.6 was supported up to and including the release 0.8.2. Python 3.3 was supported up to and including release 0.9. Python 3.6 was supported up to and including release 2.3.4.
- NumPy >= 1.9.1
- Earlier versions could work, but we don’t test it.
- SciPy >= 0.14
- Only currently required for sparse matrix and special functions support, but highly recommended. SciPy >=0.8 could work, but earlier versions have known bugs with sparse matrices.
- BLAS installation (with Level 3 functionality)
- Recommended: MKL, which is free through Conda with
mkl-service
package.- Alternatively, we suggest to install OpenBLAS, with the development headers (
-dev
,-devel
, depending on your Linux distribution).
Optional requirements
clang
(the system version)- Highly recommended. Aesara can fall back on a NumPy-based Python execution model, but a C compiler allows for vastly faster execution.
- Sphinx >= 0.5.1, pygments
- For building the documentation. LaTeX and dvipng are also necessary for math to show up as images.
- pydot-ng
- To handle large picture for gif/images.
- warp-ctc
- Required for Aesara CTC implementation. It is faster then using an equivalent graph of Aesara ops.
Requirements installation through Conda (recommended)¶
Install Miniconda¶
Follow this link to install Miniconda.
Note
If you want fast compiled code (recommended), make sure you have Clang
installed.
Install requirements and optional packages¶
conda install numpy scipy mkl pytest <sphinx> <pydot-ng>
- Arguments between <…> are optional.
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.
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:
<sudo> pip install <--user> Aesara[test, doc]
- Any argument between <…> is optional.
- Use sudo for a root installation.
- Use 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 Troubleshooting page.
Bleeding-Edge Installation (recommended)¶
Install the latest, bleeding-edge, development version of Aesara with:
<sudo> pip install <--user> <--no-deps> git+https://github.com/aesara-devs/aesara.git#egg=aesara
- Any argument between <…> is optional.
- Use sudo for a root installation.
- Use user for a user installation without admin rights. It will install Aesara in your local site-packages.
- Use 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 Troubleshooting page.
Developer Installation¶
Install the developer version of Aesara with:
git clone git://github.com/aesara-devs/aesara.git
cd aesara
<sudo> pip install <--user> <--no-deps> -e .
- Any argument between <…> is optional.
- Use sudo for a root installation.
- Use user for a user installation without admin rights. It will install Aesara in your local site-packages.
- Use 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.
- -e makes your installation editable, i.e., it links it to your source directory.
If you encountered any trouble, head to the Troubleshooting page.
Requirements through Homebrew (not recommended)¶
Install python with homebrew:
$ brew install python # or python3 if you prefer
This will install pip. Then use pip to install numpy, scipy:
$ pip install numpy scipy
If you want to use openblas instead of Accelerate, you have to install numpy and scipy with hombrew:
$ brew tap homebrew/python
$ brew install numpy --with-openblas
$ brew install scipy --with-openblas
Requirements through MacPorts (not recommended)¶
Using MacPorts 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, 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:$ 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 bywhich python
points to the MacPorts python. For instance, on MacOS X Lion with MacPorts 2.0.3, the output ofwhich python
is/opt/local/bin/python
and this symbolic link points to/opt/local/bin/python2.7
. When executingsudo 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 instancesudo 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 byprint scipy.__version__
andprint 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 ofscipy
in yourPYTHONPATH
so you should editPYTHONPATH
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$ sudo ln -s /opt/local/bin/pip-2.7 /opt/local/bin/pip