Overview
PyMechanical is a Python interface for Ansys Mechanical (FEA software for structural engineering), enabling automation and integration of simulation workflows from 2024 R2 and later.
PyMechanical provides two distinct modes of interaction:
Embedding mode — Run Mechanical directly in your Python process via the App class. Full object-model access, fast startup, ideal for Jupyter notebooks and interactive scripting.
Remote session mode — Launch Mechanical as a separate server process and communicate via gRPC. Process isolation, optional GUI, ideal for CI/CD, Docker, and automation.
Compatibility
Python: 3.12 - 3.14
Mechanical: 2024 R2 (v242) and later
Platforms: Windows, Linux
Installation
Install from PyPI:
pip install ansys-mechanical-core
For graphics support:
pip install ansys-mechanical-core[graphics]
For RPC functionality:
pip install ansys-mechanical-core[rpc]
For AI assistant integration via the Model Context Protocol (MCP):
pip install ansys-mechanical-core[mcp]
Requirements:
Licensed copy of Ansys Mechanical (2024 R2 or later).
For embedded mode: Local Mechanical installation required.
For remote session mode: Network access to a running Mechanical instance.
Quick start
Embedding mode:
from ansys.mechanical.core import App
app = App(globals=globals())
print(app)
# Access Mechanical objects directly
Model.AddStaticStructuralAnalysis()
Remote session mode:
from ansys.mechanical.core import launch_mechanical
mechanical = launch_mechanical()
result = mechanical.run_python_script("2+3")
print(result) # Output: 5
mechanical.exit()
Connect to existing instance:
from ansys.mechanical.core import connect_to_mechanical
mechanical = connect_to_mechanical(port=10000)
result = mechanical.run_python_script("Model.Name")
print(result)
Troubleshooting
Connection refused: Ensure Mechanical is running and the port is accessible.
License error: Verify your Ansys license is properly configured.
Import error: Check that ansys-pythonnet is installed (not pythonnet).
Linux embedding: Use mechanical-env to run Python scripts for embedded mode.
Documentation and support
PyMechanical-MCP — AI assistant integration via MCP
Issues — report bugs or request features
Discussions — ask questions
Release files for ansys-mechanical-core 0.13.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ansys_mechanical_core-0.13.3.tar.gz | 106.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ansys_mechanical_core-0.13.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 268.6 kB
Release files / ansys_mechanical_core-0.13.3.tar.gz
| Download URL | ansys_mechanical_core-0.13.3.tar.gz |
|---|---|
| Size | 106.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58d520f92e6f73f46a4b8b2e237c0882fa949b529198deb4326e4948e18f2d40
|
|
BLAKE2b-256 checksum How to use checksums |
cf77c08458879bdb10ae880dff22080e0d44aeec1d20b2d7b01d79dcd9837edd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / ansys_mechanical_core-0.13.3-py3-none-any.whl
| Download URL | ansys_mechanical_core-0.13.3-py3-none-any.whl |
|---|---|
| Size | 162.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b047be6e62c81536899382826e7218578f44555f01b121787798dd9efc73d46
|
|
BLAKE2b-256 checksum How to use checksums |
bd18c4d274acf358c8397682ce38eafa70ec6bc27a5c4cd4a3dfe8543bb539d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency log