Installation¶
Python¶
pyboolnet is now being developed in Python 3.8 and is not compatible with Python2. If you experience problems with your version of Python and pyboolnet please contact hannes.klarner@fu-berlin.de or post an issue on the project homepage at
Linux¶
We recommend to install the package using pip. If it is not already installed on your computer try:
$ apt install python-pip
Make sure that NetworkX, Graphviz and ImageMagick are installed:
$ pip3 install networkx
$ apt install graphviz
$ apt install imagemagick
Install pyboolnet with pip:
$ pip3 install git+https://github.com/hklarner/pyboolnet
which should place the package here:
/usr/local/lib/python<version>/dist-packages/pyboolnet
Use the option --user
(literally) if you do not have sudo rights:
$ pip3 install git+https://github.com/hklarner/pyboolnet --user
The package is likely going to be placed here:
/home/<user>/.local/lib/python<version>/dist-packages/pyboolnet
where <user>
is the name you are logged in with ($ whoami
) and <version>
is the Python version you are using.
You should now be able to import pyboolnet:
$ python
>>> import pyboolnet
To remove pyboolnet using pip run:
$ pip3 uninstall pyboolnet
If you do not have pip, all files must be removed manually.
Mac OS¶
Download the latest release from
We recommend to install the package using pip. If it is not already installed on your computer try:
$ easy_install pip
or if you do not have super user rights:
$ easy_install --user pip
Download and install Graphviz and ImageMagick from
Install pyboolnet with pip:
$ pip3 install git+https://github.com/hklarner/pyboolnet
which should place the package here:
/usr/local/lib/python<version>/dist-packages/pyboolnet
Use the option --user
(literally) if you do not have sudo rights:
$ pip3 install git+https://github.com/hklarner/pyboolnet --user
The package is likely going to be placed here:
/home/<user>/.local/lib/python<version>/dist-packages/pyboolnet
where <user>
is the name you are logged in with ($ whoami
) and <version>
is the Python version you are using.
You should now be able to import pyboolnet:
$ python
>>> import pyboolnet
To remove pyboolnet using pip run:
$ pip3 uninstall pyboolnet
If you do not have pip, all files must be removed manually.
Windows¶
Download the latest release from
We recommend to install the package using pip. If it is not already shipped with your Python version follow the instructions on
To install pyboolnet with pip:
C:\> pip.exe install git+https://github.com/hklarner/pyboolnet
which should place the package here:
C:\Python<version>\Lib\site-packages
where <version>
is the Python version you are using.
Important
Make sure you check the paths to the executables. Locate the file settings.cfg
in the Dependencies
folder of your installation and
try to run each program.
To install NetworkX use pip again:
C:\> pip.exe install networkx
To install Graphviz and ImageMagick download the respective executables from the home pages:
You should now be able to import pyboolnet:
C:\> python
>>> import PyBoolNet
To remove pyboolnet using pip run:
C:\> pip.exe uninstall PyBoolNet
If you do not have pip, all files must be removed manually.
Dependencies¶
Most of what pyboolnet does is written in pure Python but some crucial tasks, for example solving ASP problems or deciding CTL queries, are done using third party software.
The file that records the locations to third party binaries is called settings.cfg
and located in the folder binaries
of pyboolnet.
The default location is:
/usr/local/lib/python<version>/dist-packages/pyboolnet/binaries/settings.cfg
The file is a standard configuration file of name = value
pairs. The default for Linux 64 bit is:
[Executables]
nusmv = ./NuSMV-a/NuSMVa_linux64
gringo = ./gringo-4.4.0/gringo_linux64
bnet2prime = ./BNetToPrime/BNetToPrime_linux64
clasp = ./clasp-3.1.1/clasp-3.1.1-x86_64-linux
espresso = ./espresso/espresso_linux64
eqntott = ./eqntott/eqntott_linux64
dot = /usr/bin/dot
neato = /usr/bin/neato
fdp = /usr/bin/fdp
sfdp = /usr/bin/sfdp
circo = /usr/bin/circo
twopi = /usr/bin/twopi
convert = /usr/bin/convert
If you want to use your own binaries simply replace the respective paths. Note that ./
indicates a relative path while /
is an absolute path.
Make sure all these paths work and that rights for execution and access are set on linux systems.
To test whether the dependencies work correctly, run:
$ python
>>> import PyBoolNet
>>> PyBoolNet.Tests.Dependencies.run()
If you get fails or errors, read Troubleshooting and the issues section of the homepage:
where you can also post issues. Also, do not hesitate to contact me at hannes.klarner@fu-berlin.de.
NetworkX¶
NetworkX is a Python package and required for standard operations on directed graphs, e.g. computing strongly connected components, deciding if a path between two nodes exists. The package is available at:
To install it on Linux using pip run:
$ pip3 install networkx
or:
$ pip3 install networkx --user
if you do not have super user rights.
BNetToPrime¶
BNetToPrime stands for “Boolean network to prime implicants”. It is necessary to compute the prime implicants of a Boolean network. It is included in every release and should work out of the box. The binaries and source are available at:
Potassco¶
The Potassco answer set solving collection consists of the ASP solver clasp and the grounder gringo, see Gebser2011. They are necessary to compute trap spaces by means of stable and consistent arc sets in the prime implicant graph, see Klarner2015(a). They are included in every release and should work out of the box.
Note
The development of the Potassco solving collection is active with frequent releases. pyboolnet is tested with two specific versions, clasp-3.1.1 and gringo-4.4.0 and we strongly recommend you use them because of syntax differences between versions.
The binaries and source are available at:
NuSMV¶
NuSMV is a symbolic model checker that we use to decide LTL and CTL queries. pyboolnet requires the extension NuSMV-a for model checking with accepting states. It is included with every release and should work out of the box.
Note
pyboolnet is tested with NuSMV-a, an extension of NuSMV 2.6.0. If you do not need to compute accepting states you may use the regular NuSMV 2.6.0.
Binaries and source available at:
Graphviz¶
The program dot is part of the graph visualization software Graphviz and available at
It is required to generate drawings of interaction graphs and state transition graphs. To install it on Linux run:
$ apt install graphviz
Make sure to check the paths in settings.cfg
.
ImageMagick¶
The program convert is part of the ImageMagick software suite. It is required to generate animations of trajectories in the state transition graph. To install it on linux run:
$ apt install ImageMagick
ImageMagick is available at
Make sure to check the paths in settings.cfg
.
Matplotlib¶
The package matplotlib is used to plot pie charts and bar plots and similiar graphs, for example in the function create_barplot and basins_create_piechart of the Basins module. To install it on linux run:
$ pip3 install matplotlib
matplotlib is available at
Espresso¶
Espresso is required for heuristic minimization Boolean expressions. For more information see
Eqntott¶
Eqntott is required to converting Boolean expressions into the truth table format required by Espresso. For more information see
Troubleshooting¶
For questions that are not listed here please contact hannes.klarner@fu-berlin.de or post an issue on the project homepage at
libreadline.so.6¶
If you get the error message:
./NuSMVa: error while loading shared libraries: libreadline.so.6:
cannot open shared object file: No such file or directory
then a solution for linux is available at stackoverflow:
The crucial command:
$ apt install libreadline6:i386
permission denied¶
If you get permission denied erros like:
OSError: [Errno 13] Permission denied
you might have to change the mode of the files to make sure that they are executable. Locate the directory that contains pyboolnet (see Installation of PyBoolNet above) and run:
../PyBoolNet$ chmod -R 744 Dependencies/
../PyBoolNet$ chmod -R +x Dependencies/
../PyBoolNet$
no such file or directory¶
If you get No such file or directory errors you might have installed the wrong package for your OS. In particular check whether you are on 32 bit or 64 bit Linux and download the respective files from: