-
Notifications
You must be signed in to change notification settings - Fork 8
Installation
Here we explain how to install PyFRAP and all required software. For PyFRAP to run, you need the following ingredients:
- A Python (Version 2.7) installation with all required packages installed
- Gmsh
- Fiji
- PyFRAP
PyFRAP can be installed in multiple ways depending on the user's needs. Here we provide two ways of installing PyFRAP for all three major operation systems (Windows, OSX, Linux):
- A quick and easy installation guide using installation scripts and the Anaconda Python distribution. These instructions are aimed at users with little knowledge about Python and command line terminals. Using this guide you will automatically have installed all 4 previously mentioned ingredients to run PyFRAP.
- A detailed description on how to install all packages manually. These instructions are suitable for users who are familiar with Python and probably already have a working Python installation running.
In general we recommend using PyFRAP with Ubuntu Linux, since PyFRAP proves to be the easiest to install and use under this OS. s
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. Also note that to make use of some of PyFRAP's meshing functionalities, you need to install and link openscad. For Linux users, openscad already gets installed using the following script.
We recommend following the following steps carefully to guarentee a working PyFRAP installation.
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 (Python version 2.7) as described here.
- Download and unzip PyFRAP to your computer.
- In Finder, navigate to your PyFRAP folder.
- Double-click on install_osx.command (you might need to press Control meanwhile, or allow apps from anywhere, see here).
- Run PyFRAP by double-clicking runPyFRAP.command (you might need to press Control meanwhile, or allow apps from anywhere, see here).
Optional: If you want to use some of PyFRAP's more complicated meshing options, you will need to install openscad.
- Download and install openscad from here.
- In PyFRAP, go to settings and adjust the path (FolderContainingPyFRAP\pyfrp\executables\openscad\openscad.app).
- Install Anaconda (Python version 2.7) as described here (in the Advanced Installation Options, check the Add Anaconda to my PATH environment variable option).
- Download and unzip PyFRAP to your computer.
- In explorer, navigate to your PyFRAP folder.
- Double-click on install_win.bat.
- Copy gmsh to your Anaconda Scripts folder
- Find your Anaconda installation directory (You can use the Windows find function and search for python.exe. Most of the time it is located in C:\Users\YourUserName\AppData\Local\Continuum\Anaconda)
- At the same time, in your PyFRAP installation directory, navigate to *FolderContainingPyFRAP\pyfrp\executables\gmsh* (where FolderContainingPyFRAP is your PyFRAP installation directory).
- Copy gmsh.exe to the Scripts folder in the Anaconda installation folder.
- 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 (where FolderContainingPyFRAP is your PyFRAP installation directory).
- Click OK and then Apply.
- Run PyFRAP by double-clicking runPyFRAP.bat.
- Go to settings and adjust the path to gmsh.
- In PyFRAP, go to Settings -> Set Gmsh Path -> Change
- Select gmsh.exe which should be located in FolderContainingPyFRAP\pyfrp\executables\gmsh\gmsh.exe
- Click Done
- Go to settings and adjust the path to Fiji.
- In PyFRAP, go to Settings -> Set Fiji Path -> Change
- Select ImageJ.exe which should be located in FolderContainingPyFRAP\pyfrp\executables\Fiji\ImageJ.exe
- Click Done
Optional: If you want to use some of PyFRAP's more complicated meshing options, you will need to install openscad.
- Download and install openscad from here.
- In PyFRAP, go to settings and adjust the path (FolderContainingPyFRAP\pyfrp\executables\openscad\openscad.exe).
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. 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).
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.