Installation¶
The requirements for pypfilt are:
Recommended method¶
The simplest way to install these packages (particularly on Windows) is to
use Anaconda, which automatically
installs them all by default.
You can also use a package manager, such as apt-get
(Debian, Ubuntu),
yum
(Red Hat, CentOS), dnf
(Fedora), or Homebrew
(OS X).
Source installation on Linux and OS X¶
Alternatively, these packages can be manually installed in a Virtual Environment, by using virtualenv.
Note
Installing from source on Windows is effectively impossible, due to the dependencies of h5py.
First, ensure that virtualenv
and the libhdf5
development files are
installed; the instructions shown here are for Debian:
sudo apt-get install virtualenv libhdf5-dev
Then create a virtual environment (here, called venv-pypfilt
):
# Create and activate the virtual environment.
virtualenv -p /usr/bin/python2 venv-pypfilt
source venv-pypfilt/bin/activate
# Install NumPy before SciPy, and Cython before h5py.
pip install 'numpy>=1.8' 'Cython >=0.17'
pip install 'scipy>=0.11'
# Note: ensure the HDF5_DIR variable is set correctly.
# It must point to the directory that contains `include/hdf5.h`.
export HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial
pip install 'h5py>=2.2'
Once the required packages have been installed (see instructions, above), you
can clone the pypfilt repository and install it in the venv-pypfilt
virtual environment:
# Activate the virtual environment.
source venv-pypfilt/bin/activate
# Clone the pypfilt repository.
git clone https://bitbucket.org/robmoss/particle-filter-for-python.git
cd particle-filter-for-python
# Install pypfilt in the virtual environment.
python setup.py install
If you are not using a virtual environment, and you don’t have permission to install pypfilt system-wide, you can install the package locally:
# Clone the pypfilt repository.
git clone https://bitbucket.org/robmoss/particle-filter-for-python.git
cd particle-filter-for-python
# Install pypfilt in the user's "site-packages" directory.
python setup.py install --user
Building the documentation¶
If you want to build the documentation locally, you will need to install Sphinx 1.3 or newer, and the Read the Docs Sphinx Theme.
These can be installed through a package manager; the instructions shown here are for Debian:
sudo apt-get install python-sphinx python-sphinx-rtd-theme
Alternatively, they can be installed in the venv-pypfilt
virtual
environment:
# Activate the virtual environment.
source venv-pypfilt/bin/activate
pip install 'Sphinx>=1.3' sphinx_rtd_theme
You can then build the documentation from the pypfilt repository, which
will be written to the doc/build/html
directory:
python setup.py build_sphinx