pgmpy requires Python 3.7+. pgmpy is hosted on both pypi and anconda. For installation through pypi, use the command:

pip install pgmpy

For installation through anaconda, use the command:

conda install -c ankurankan pgmpy

For installing the latest dev branch from github, use the command:

pip install git+


If installing manually, the following non-optional dependencies needs to be installed:

  • Python 3.7+

  • numpy

  • scipy

  • scikit-learn

  • pandas

  • pyparsing

  • pytorch

  • statsmodels

  • tqdm

  • joblib