The standard package installer for Python is pip.
To use PyDPF-Core with Ansys 2021 R2 or later, install the latest version with this command:
pip install ansys-dpf-core
PyDPF-Core plotting capabilities require to have PyVista installed. To install PyDPF-Core with its optional plotting functionalities, use:
pip install ansys-dpf-core[plotting]
For more information about PyDPF-Core plotting capabilities, see Plot.
To use PyDPF-Core with Ansys 2021 R1, install the latest version with this command:
pip install ansys-dpf-core<0.3.0
Install without internet#
If you are unable to install PyDPF-Core on the host machine using
pip due to
network isolation, download the wheelhouse corresponding to your platform and Python interpreter version
for the latest release of PyDPF-Core from the assets section of the latest PyDPF-Core release on GitHub.
The wheelhouse is a ZIP file containing Python wheels for all the packages PyDPF-Core requires to run. To install PyDPF-Core using the downloaded wheelhouse, unzip the wheelhouse to a local directory, then use the following command from within this local directory:
pip install --no-index --find-links=. ansys-dpf-core
Beware that PyDPF-Core wheelhouses do not include the optional plotting dependencies. To allow for plotting capabilities, also download the wheels corresponding to your platform and Python interpreter version for PyVista and matplotlib, then place them in the same previous local directory and run the command above.
Install in development mode#
If you want to edit and potentially contribute to PyDPF-Core,
clone the repository and install it using
pip with the
git clone https://github.com/pyansys/pydpf-core cd pydpf-core pip install -e .
Check the installation#
Run the following Python code to verify your PyDPF-Core installation:
from ansys.dpf.core import Model from ansys.dpf.core import examples model = Model(examples.find_simple_bar()) print(model)