DoWhy support Python 3.6+. To install, you can use pip or conda.
Install the latest release using pip.
pip install dowhy
Install the latest release using conda.
conda install -c conda-forge dowhy
If you face “Solving environment” problems with conda, then try conda update –all and then install dowhy. If that does not work, then use conda config –set channel_priority false and try to install again. If the problem persists, please add your issue here.
If you prefer the latest dev version, clone this repository and run the following command from the top-most folder of the repository.
pip install -e .
DoWhy requires the following packages:
- networkx (for analyzing causal graphs)
- matplotlib (for general plotting)
- sympy (for rendering symbolic expressions)
- If you face any problems, try installing dependencies manually.
pip install -r requirements.txt
Optionally, if you wish to input graphs in the dot format, then install pydot (or pygraphviz).
For better-looking graphs, you can optionally install pygraphviz. To proceed, first install graphviz and then pygraphviz (on Ubuntu and Ubuntu WSL).
sudo apt install graphviz libgraphviz-dev graphviz-dev pkg-config
## from https://github.com/pygraphviz/pygraphviz/issues/71
pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" \
Install the latest release from PyPI:
> pip install econml
You can get started by cloning this repository. We use
setuptools for building and distributing our package.
We rely on some recent features of setuptools, so make sure to upgrade to a recent version with
pip install setuptools --upgrade. Then from your local copy of the repository you can run
pip install -e . to get started (but depending on what you’re doing you might want to install with extras instead, like
pip install -e .[plt] if you want to use matplotlib integration, or you can use
pip install -e .[all] to include all extras).
Running the tests
This project uses pytest for testing. To run tests locally after installing the package, you can use
pip install pytest-runner followed by
python setup.py pytest.
We have added pytest marks to some tests to make it easier to run a subset, and you can set the PYTEST_ADDOPTS environment variable to take advantage of this. For instance, you can set it to
-m "not (notebook or automl)" to skip notebook and automl tests that have some additional dependencies.
Generating the documentation
This project’s documentation is generated via Sphinx. Note that we use graphviz’s
dot application to produce some of the images in our documentation, so you should make sure that
dot is installed and in your path.
To generate a local copy of the documentation from a clone of this repository, just run
python setup.py build_sphinx -W -E -a, which will build the documentation and place it under the
The reStructuredText files that make up the documentation are stored in the docs directory; module documentation is automatically generated by the Sphinx build process.
Causal-learn needs the following packages to be installed beforehand:
- python 3 (>=3.7)
To use causal-learn, we could install it using pip:
> pip install causal-learn