To install the PySD package from the Python package index use the pip command:
pip install pysd
To install PySD with conda, using the conda-forge channel, use the following command:
conda install -c conda-forge pysd
To install from source, clone the project with git:
git clone https://github.com/JamesPHoughton/pysd.git
or download the latest version from the project repository: https://github.com/JamesPHoughton/pysd
In the source directory use the command:
python setup.py install
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.
In order to plot model outputs as shown in Getting started <../getting_started>
:
- Matplotlib
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.
The PySD Cookbook contains recipes that can help you get set up with PySD.