Installing from source requires you to have installed
Python3
networkx
(==1.8.1)numpy
(==1.9.1)scipy
(==0.14.0)cython
(==0.21)pandas
(==0.15.1)setuptools
C
and C++
compilerYou can install all these requirements by issuing
$ [sudo] apt-get install build-essential python3-dev python3-pip
$ [sudo] pip3 install -r requirements.txt # use requirements-dev.txt if you want to run tests
On Red Hat and clones (e.g CentOS), install the dependencies using:
$ [sudo] yum -y install gcc gcc-c++ python3-devel python3-pip
$ [sudo] pip3 install -r requirements.txt # use requirements-dev.txt if you want to run tests
Or use some cross-platform binary package manager such as conda (it is recommended as well as the most easiest and hastle-free way)
Setup a virtual environment in conda
by
$ conda create -n pgmpy-env python=3.4
$ source activate pgmpy-env
Once you have the virtual environment setup, install the depenedencies using:
$ conda install -f requirements.txt # use requirements-dev.txt if you want to run tests
Note
In order to build the documentation you will need sphinx
and to run the tests you will need nose
$ [sudo] pip3 install sphinx nose
You can install from source by downloading a source archive file (zip) or by checking out the
source files from git
source repository.
Download the source (zip file) from https://github.com/pgmpy/pgmpy or clone the pgmpy repository:
$ git clone https://github.com/pgmpy/pgmpy
$ git checkout dev
Unpack (if necessary) and change directory to the source directory.
Run:
$ [sudo] python3 setup.py install
Testing requires having the nose
library. After installation, the package can be tested by executing
from the source directory:
$ nosetests3
This would give you a lot of output (and some warnings) but eventually should finish without errors. Otherwise, please consider posting an issue into the bug tracker or the Mailing List pgmpy@googlegroups.com .