To install FEniCS on Windows 10, enable the Windows Subsystem for Linux and install the Ubuntu distribution. Then follow the instructions for Ubuntu below.
Building FEniCS from source
For installation in high performance computing clusters we recommend always building from source. For detailed instructions, see the FEniCS Reference Manual.
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.
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).
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:
Anaconda Install Mac M1
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:
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.
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-dev
on 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++--version
in a terminal). If not, use your distribution’s package manager to install ag++
package.
Anaconda Install Location Mac
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):
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.
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.
Another option is to use pip
to directly install from github:
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.