Anaconda Install Mac



We recommend users to use the Anaconda distributionby Continuum Analytics. Its use will make the installation of Brian 2 and itsdependencies simpler, since packages are provided in binary form, meaning thatthey don’t have to be build from the source code at your machine. Furthermore,our automatic testing on the continuous integration services travis and azureare based on Anaconda, we are therefore confident that it works under thisconfiguration.

On Linux and Mac OS X, the conda package will automatically install a C compiler. But even if you install Brian from source, you will most likely already have a working C compiler installed on your system (try calling g-version in a terminal). If not, use your distribution’s package manager to install a g package.

However, Brian 2 can also be installed independent of Anaconda, either withother Python distributions (Enthought Canopy,Python(x,y) for Windows, …) or simplybased on Python and pip (see Installation with pip below).

  1. If you are using Mac OS X or Microsoft Windows you will need to install a Python distribution yourself. Details of how to do this are in the installation instructions of the corresponding platform. Kwant version 1.2 and newer requires at least Python 3.4.
  2. Anaconda is also compatible with Mac, Windows, and Linux operating systems. Two of the prominent depository tools contained within Anaconda include the navigator. It is always recommended to install the latest version of any open-source server that you intend to install on Linux.
  3. Anaconda: The easiest way to install the packages described in this post is with the conda command line tool in Anaconda Distribution. If you are new to Anaconda Distribution, the recently released Version 5.0 is a good place to start, but older versions of Anaconda Distribution also can install the packages described below.

Installing Anaconda¶

Download the Anaconda distributionfor your Operating System. Note, Brian 2 no longer supports Python 2 (the lastversion to support Python 2 was brian2.3).

After the installation, make sure that your environment is configured to usethe Anaconda distribution. You should have access to the conda command ina terminal and running python (e.g. from your IDE) should show a header likethis, indicating that you are using Anaconda’s Python interpreter:

Here’s some documentation on how to set up some popular IDEs for Anaconda:https://docs.anaconda.com/anaconda/user-guide/tasks/integration

Installing Brian 2¶

Note

The provided Brian 2 packages are only for 64bit systems. Operating systems running32bit are no longer officially supported, but Installation with pip mightstill work.

You can either install Brian 2 in the Anaconda root environment, or create anew environment for Brian 2 (https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).The latter has the advantage that you can update (or not update) the dependenciesof Brian 2 independently from the rest of your system.

Brian 2 is not part of the main Anaconda distribution, but built using thecommunity-maintained conda-forge project. Youwill therefore have to to install it from theconda-forge channel. To do so, use:

You can also permanently add the channel to your list of channels:

This has only to be done once. After that, you can install and update the brian2packages as any other Anaconda package:

Installing other useful packages¶

There are various packages that are useful but not necessary for working withBrian. These include: matplotlib (for plotting), pytest (for running the testsuite), ipython and jupyter-notebook (for an interactive console). To installthem from anaconda, simply do:

You should also have a look at the brian2tools package, which contains severaluseful functions to visualize Brian 2 simulations and recordings. You caninstall it with pip or anaconda, similar to Brian 2 itself (but as of now, it isnot included in the conda-forge channel, you therefore have to install itfrom our own brian-team channel), e.g. with:

If you decide not to use Anaconda, you can install Brian 2 from the Pythonpackage index: https://pypi.python.org/pypi/Brian2

To do so, use the pip utility:

Anaconda

You might want to add the --user flag, to install Brian 2 for the local useronly, which means that you don’t need administrator privileges for theinstallation.

Anaconda

Note that when installing brian2 from source with pip, support for usingnumerical integration with the GSL requires a workinginstallation of the GSL development libraries (e.g. the package libgsl-devon Debian/Ubuntu Linux).

C++ code generation is highly recommended since it can drastically increase thespeed of simulations (see Computational methods and efficiency for details). To use it,you need a C++ compiler and Cython.Cython will be automatically installed if you perform the installation viaAnaconda, as recommended. Otherwise you can install them in the usual way, e.g.using pipinstallcython.

Linux and OS X¶

On Linux and Mac OS X, the conda package will automatically install a C++ compiler.But even if you install Brian from source, you will most likely already have aworking C++ compiler installed on your system (try calling g++--versionin a terminal). If not, use your distribution’s package manager to install ag++ package.

Anaconda Install Mac Os

Windows¶

On Windows, the necessary steps to get Runtime code generation (i.e. Cython) to workdepend on the Python version you are using (also see thenotes in the Python wiki):

  • Install the Microsoft Build Tools for Visual Studio 2017.

  • Make sure that your setuptools package has at least version 34.4.0 (use condaupdatesetuptools when using Anaconda, or

    pipinstall--upgradesetuptools when using pip).

For Standalone code generation, you can either use the compiler installed above or any other version of Visual Studio – in thiscase, the Python version does not matter.

Try running the test suite (see Testing Brian below) after theinstallation to make sure everything is working as expected.

Anaconda Install Mac

To run the latest development code, you can directly clone the git repository at github(https://github.com/brian-team/brian2) and then run pipinstall-e., to installBrian in “development mode”. With this installation, updating the git repository is ingeneral enough to keep up with changes in the code, i.e. it is not necessary to installit again.

Anaconda Install Mac

Another option is to use pip to directly install from github:

Install Anaconda Mac Big Sur

If you have the pytest testing utility installed, you can run Brian’s testsuite:

It should end with “OK”, showing a number of skipped tests but no errors orfailures. For more control about the tests that are run see thedeveloper documentation on testing.