Getting started
Last update: 20.02.2026Prime Mesh Python client library 2025 R2 SP4 is a modified version of the PyPrimeMesh. You can access the latest Prime Mesh Python client library from the latest Ansys package. For more information on getting a licensed copy of Ansys, visit the Ansys website.
Installation
Install the latest Prime Mesh Python client library from Ansys Customer Site.
Run a Python script in batch
To run a PyPrimeMesh Python script directly on the server from a Linux or Windows console:
Here is a Windows code example to run a Python script directly from the command line:
"%AWP_ROOT<version>%\meshing\Prime\runPrime.bat" my_script.py
Run a Python script in batch on HPC job scheduler
To run the PyPrimeMesh Python script with SLURM HPC job scheduler while launching the Ansys Prime Server, use the following argument:
import ansys.meshing.prime as prime
client = prime.launch_prime(scheduler='slurm', n_procs = 4)
model = client.model
You can run the PyPrimeMesh Python script with SLURM from the command line as follows:
"%AWP_ROOT<version>%\meshing\Prime\runPrime.bat" my_slurm_script.py
Accessing Prime Mesh Python client library through Visual Studio Code (VS Code)
You can access Prime Mesh Python client through VS code and work on it as follows:
-
Install 2024R1 Service Pack 1 package or later.
-
Close all instances of VS Code.
-
Create a new folder in your machine for your work.
-
Open VS Code.
-
Click File > Open Folder and select the newly created folder from the location.
-
Install Microsoft Python Extension in VS Code if you have not installed it.
-
In the VS Code, click the Search bar and select Show and Run Commands > Python: Select Interpreter.
-
In Windows OS, click Enter Interpreter Path and click Find to select runPrime.bat as interpreter from the latest package installed location.

Example: C:\Program Files\ANSYS Inc\v252\meshing\Prime\runPrime.bat
In Linux OS, press Ctrl + Shift + P to view the search bar and type Python: Select Interpreter and select it.
Example:/ANSYS_Inc/v252/meshing/Prime/runPrime.sh
-
In VS Code, create a new folder with name .vscode.
-
Create a settings.json file with the following content:
In Windows OS,
{ "python.autoComplete.extraPaths": [ "C:\\Program Files\\ANSYS Inc\\v252\\meshing\\site" ], "python.analysis.extraPaths": [ "C:\\Program Files\\ANSYS Inc\\v252\\meshing\\site" ], }In Linux OS,
{ "python.autoComplete.extraPaths": [ "\ansys_inc\v252\meshing\site" ], "python.analysis.extraPaths": [ "\ansys_inc\v252\meshing\site" ], }Note: Environment variables do not work in the above file. Hence, provide full paths.
-
Run a simple test file to ensure that the installed build works.
import ansys.meshing.prime as prime
with prime.launch_prime() as client:
model = client.model
print (prime.__version__)
```</version></version>