This guide offers detailed, step-by-step instructions for installing PM4Py on both Windows and Linux. It covers all necessary prerequisites, including installing Python, pip, and Graphviz, and concludes with a verification step to confirm that the installation was successful.
You can choose between installing Python directly or using Anaconda/Miniconda for a managed environment.
cmd
) and execute the following commands to verify your Python and pip installations:python --version pip --version
python get-pip.py
python --version pip --versionThese commands should display the installed versions of Python and pip.
conda create -n pm4py_env python=3.11
conda activate pm4py_env
To use PM4Py’s visualization features, Graphviz must be installed and properly configured.
graphviz-X.XX.X.msi
. dot.exe
can be run from the Command Prompt. bin
folder (usually at:C:\Program Files\Graphviz\bin
or C:\Program Files (x86)\Graphviz\bin
). bin
path.To confirm the setup, open a new Command Prompt and run:
dot -VIf the command displays the version (e.g.,
dot - graphviz version X.XX.X
), Graphviz is correctly configured. pip install graphvizThis installs the Python package that allows PM4Py to interface with Graphviz.
dot -VIf the version information appears without errors, Graphviz is installed and ready to use.
pip install pm4py
pythonOnce inside the shell, enter the following command:
import pm4pyIf no errors are shown, PM4Py has been installed successfully. To exit the shell, type:
exit()
Most Linux distributions (e.g., Ubuntu, Debian, Fedora) come with Python pre-installed. This guide will help ensure you have the correct Python version and pip
installed.
sudo apt update sudo apt upgrade
python3 --versionIf Python 3.11 or newer is not installed, install it:
sudo apt install python3.11
pip
if it's not already available: sudo apt install python3-pipThen verify the installation:
pip3 --version
sudo apt install python3-venvCreate and activate a new virtual environment:
python3 -m venv pm4py_env source pm4py_env/bin/activate
sudo apt install graphviz
sudo dnf install graphviz
pip3 install graphviz
dot -VIf it prints the version information without errors, the installation was successful.
pip3 install pm4py
python3Then enter the following command:
import pm4pyIf no errors are displayed, PM4Py is installed successfully. Exit the Python shell with:
exit()
pip
is installed. On Linux, use pip3
instead of pip
. graphviz
package is also installed. pip install --force-reinstall pm4py