Installation

Installing via pip

To install the PySD package from the Python package index use the pip command:

pip install pysd

Installing with conda

To install PySD with conda, using the conda-forge channel, use the following command:

conda install -c conda-forge pysd

Installing from source

To install from source, clone the project with git:

git clone https://github.com/SDXorg/pysd.git

or download the latest version from the project repository: https://github.com/SDXorg/pysd

In the source directory use the command:

python setup.py install

Required Dependencies

PySD requires Python 3.7 or above.

PySD builds on the core Python data analytics stack, and the following third party libraries:

  • Numpy

  • Scipy

  • Pandas

  • Parsimonious

  • xarray

  • xlrd

  • lxml

  • regex

  • chardet

  • black

  • openpyxl

  • progressbar2

  • portion

These modules should build automatically if you are installing via pip. If you are building from source, or if pip fails to load them, they can be loaded with the same pip syntax as above.

Optional Dependencies

In order to plot model outputs as shown in Getting started:

  • Matplotlib

In order to be able to export data to netCDF (.nc) files:

  • netCDF4

These Python libraries bring additional data analytics capabilities to the analysis of SD models:

  • PyMC: a library for performing Markov chain Monte Carlo analysis

  • Scikit-learn: a library for performing machine learning in Python

  • NetworkX: a library for constructing networks

  • GeoPandas: a library for manipulating geographic data

Additionally, the System Dynamics Translator utility developed by Robert Ward is useful for translating models from other system dynamics formats into the XMILE standard, to be read by PySD.

These modules can be installed using pip with a syntax similar to the above.

Additional Resources

The PySD Cookbook contains recipes that can help you get set up with PySD.