← All projects

Open source · Maintainer · MIT License

PyMechanical

The Pythonic interface to Ansys Mechanical. Script, automate, and integrate structural simulation workflows from Python.

PyMechanical logo

What it is

PyMechanical is part of the PyAnsys open-source ecosystem. It gives Python programs direct access to Ansys Mechanical, so engineers can drive structural simulations with scripts instead of clicks. I maintain the project, with ownership across testing, releases, CI/CD, and documentation.

Two ways to run Mechanical

  • Embedding mode. Mechanical runs in-process through the App class, so Python and Mechanical share one process.
  • Remote session mode. Mechanical runs as a separate process, and Python talks to it over gRPC. Start one with launch_mechanical, or attach to a running instance with connect_to_mechanical.

Getting started

Install the package with pip install ansys-mechanical-core. Optional extras add graphics, RPC, and MCP support. A licensed Ansys Mechanical installation (2024 R2 or later) is required.

At a glance

LanguagePython 3.12–3.14
SupportsAnsys Mechanical 2024 R2 and later
PlatformsWindows and Linux
TransportIn-process embedding or gRPC
LicenseMIT