-
Notifications
You must be signed in to change notification settings - Fork 8
Installation
PyFRAP is written in Python2.7. If you do not have a running Python installation yet, we highly recommend using Ananconda. Anaconda is a Python distribution, bringing almost all packages that PyFRAP needs to run ( PyQT, numpy, scipy , matplotlib , colorama ) in its default installation. Installation instructions on how to install all remaining necessary packages can be found here . Anaconda can be downloaded for all three major OSs here.
If you have git installed, you can download PyFRAP via:
git clone https://github.com/alexblaessle/PyFRAP
You can also download PyFRAP using this link (You will need to unzip the file).
We provide an installation script for PyFRAP for each of the three major operating systems (OSX, Windows, Linux). This section describes how to install PyFRAP using these scripts. This assumes that your computer does not have any specific python installations running. Moreover, it will automatically download Fiji and Gmsh. Note that the installation can take a while depending on the download speed of Gmsh and Fiji.
This describes how to install PyFRAP on Debian-based operating systems such as Ubuntu. Linux generally already comes with a Python installation so it is not necessary to install Anaconda. The following instructions only work with a native Python installation.
- Download PyFRAP as described here.
- Open a terminal and navigate to the folder containing PyFRAP.
- Type
sudo ./install_linux.sh
- Type
./runPyFRAP.sh
Even though OSX comes with a Python installation, we highly recommend using Anaconda instead. The following instructions only work with Anaconda.
- Install Anaconda as described here.
- Download PyFRAP as described here.
- In Finder, navigate to your PyFRAP folder.
- Double-click on install_osx.command (you might need to press Control meanwhile, see here).
- Run PyFRAP by double-clicking runPyFRAP.command (you might need to press Control meanwhile, see here).
- Install Anaconda as described here (in the Advanced Installation Options, check the Add Anaconda to my PATH environment variable option).
- Download PyFRAP as described here.
- In explorer, navigate to your PyFRAP folder.
- Double-click on install_win.bat.
- Add gmsh to your PATH:
- In explorer, right click on This PC and select Properties.
- Click on Advanced system settings.
- Click on Environment Variables.
- Click on the upper Edit button.
- Append the ;FolderContainingPyFRAP\pyfrp\executables\gmsh.
- Click Apply.
- Run PyFRAP by double-clicking runPyFRAP.bat.
- Go to settings and adjust the path to gmsh (FolderContainingPyFRAP\pyfrp\executables\gmsh\gmsh.exe).
- Go to settings and adjust the path to Fiji (FolderContainingPyFRAP\pyfrp\executables\gmsh\gmsh.exe).
If you have setuptools installed, you can install PyFRAP via:
python setup.py install --user
We highly recommend installing with the --user option, since PyFRAP needs to read/write data files in the installation folder. In some cases, this might lead to file permission issues.
PyFRAP installation can automatically download and install Gmsh and Fiji when executing setup.py and automatically link the two executables with PyFRAP. For this to work, you need to install wget. To install wget, type
pip install wget
or if you use the Ananconda distribution
conda install pywget
PyFRAP relies heavily on Gmsh for its generation of finite element meshes that are used for PDE simulations. If you want Gmsh to be installed automatically, expand your installation command by the --gmsh flag:
python setup.py install --user --gmsh
Fiji is a image processing package wrapping ImageJ with tons of useful plugins and scripts. PyFRAP uses it mostly to handle microscope image formats. If you want Fiji to be installed with PyFRAP automatically, expand your installation command by the --gmsh flag:
python setup.py install --user --fiji
If you are interested about details of the setup.py
and want to learn more about all the options, check out the PyFRAP setup.py
API .
PyFRAP relies on a bunch of non-standard python packages. Here we describe how to install them for all three major OSs.
Generally, all Linux distributions come with a proper installation of Python2.7, so installing it will not be required. If you are using a Debian-based Linux distribution such as Ubuntu, most of the packages that PyFRAP requires are in the package manager. So to install them, type (you will need sudo rights):
sudo apt-get install python-numpy
sudo apt-get install python-scipy
sudo apt-get install python-matplotlib
sudo apt-get install python-qt4
sudo apt-get install python-skimage
sudo apt-get install python-vtk
Installation instruction for all remaining packages can be found here.
Even though OSX comes with a native Python2.7 installation, we do not recommend using it. Either use Anaconda , see here , or homebrew, a great package manager for OSX. A good installation guide for Python via homebrew can be found here.
Having installed homebrew and Python, check if you installed Python properly (that means that you added your new Python to PATH and restarted your terminal) by typing
which python
Your output should be
/usr/local/bin/python
Now we can install all other packages using either homebrew or pip.
For PyFRAP's GUI, download and install PyQT4 and SIP by typing into the Terminal
brew install sip
brew install pyqt
brew linkapps
Numpy is the main numerical python library. Download and install it by typing into the Terminal
pip install cython
pip install nose
brew install numpy
brew link numpy
Sometimes NumPy can also be found by typing into the Terminal
brew install homebrew/python/numpy
brew link numpy
Download and install SciPy by typing into the Terminal
pip install scipy
or
brew install scipy
Download and install Matplotlib by typing into the Terminal
pip install python-dateutil
pip install pyparsing
brew install matplotlib
For a better performance during the FRAP simulations we recommend using the pysparse package. Currently it seems that this package is corrupted in pip (might change in the next update), so building it from source is necessary. To do so, go here and download the latest version of pysparse. Unpack the downloaded file and go to the folder containing the unpacked files by typing
cd path/to/unpacked_files
Build the pyparse package by typing python setup.py install
Installation instructions for all additionally necessary packages can be found here
If you are using Anaconda, you should look here. If not, use
brew install --with-python --with-qt vtk7
Windows is not shipped with any version of Python2.7. Hence you must install it either using Anaconda (recommended), or install Python and all packages manually. Most of the packages come with installers, however some packages might need some powershell commands. Here we guide you through the most basic steps:
Download and install the current version of Python 2.7x.
Download and install the current version of PyQt4. The Windows installer will also install the required package SIP an all necessary QT libraries.
Download and install the current version of scipy-stack. scipy-stack includes important Python packages such as nose, numpy, scipy and matplotlib. If you want to install the packages separately because there is no suitable installation binary of scipy-stack available, you can use the following links. However, we recommend using scipy-stack:
All packages on http://www.lfd.uci.edu/~gohlke/pythonlibs are provided as wheel (.whl) format. To install a wheel package, type
pip install wheelpackage . whl
Download and install the current version of scikit-image.
Pysparse is a Python wrapper for solvers of sparse matrices. Download it and install the current version
of pyparse. In case of a 64bit system, there is a mistake in the
file pysparse package that is easy to fix. The code of the function addAt in the file pysparseMatrix.py needs to be changes
to:
def addAt(self, vector, id1, id2):
import numpy as np
id1=id1.astype(np.int32)
id2=id2.astype(np.int32)
self.matrix.update_add_at(vector, id1, id2)
Download and install the current version of vtk.
FiPy is a Python based PDE simulation toolbox. FiPy can be found in the Python Package index ( pip ) and thus installed via
pip install fipy
Scikit image is a image manipulation library based on scipy. PyFRAP uses it to load image data and apply denoising and smoothening filters. It can be installed via
pip install -U scikit-image
meshio is a neat little package being able to convert between mesh formats. PyFRAP uses it to convert Gmsh files into .vtk files for mesh plots. It can be installed via
pip install meshio
vtk is a visualization toolkit used by PyFRAP to draw meshes. If you are using Anaconda, type
conda install -c https://conda.anaconda.org/anaconda vtk
If you are not using Anaconda, look to the OS specific installation instructions on how to install vtk.