PyPIM (ansys-platform-instancemanagement) is a Python wrapper that provides a Pythonic interface to communicate with the Ansys Product Instance Management (PIM) API. This library enables users to programmatically start Ansys products in remote environments and interact with their APIs. It's designed to simplify the management of service-oriented applications within the Ansys ecosystem. The library is currently at version 1.1.2 and maintains an active release cadence.
pip install ansys-platform-instancemanagementVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to connect to the Ansys PIM API using PyPIM. A crucial step is configuring the environment externally via a JSON file and the `ANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIG` environment variable, as PyPIM is not self-configuring. The example includes checking if the environment is configured and establishing a connection.
Review the PyPIM documentation for `v1.0.0` and later to update any incompatible API calls. Ensure your code adheres to the stable API definitions.
Ensure you have access to and are correctly pointing to a deployed Ansys PIM API server instance. Without a running PIM service, PyPIM cannot function.
Create a valid JSON configuration file with the PIM API URI and other settings (as shown in the quickstart). Set the `ANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIG` environment variable to the absolute path of this file before calling `pypim.connect()`.
Always use the latest stable version of `ansys-platform-instancemanagement` to benefit from dependency fixes. If conflicts arise, consider using a dedicated virtual environment or checking the `grpcio` and `protobuf` versions installed.
If your PIM API endpoint uses TLS, upgrade to `ansys-platform-instancemanagement==1.1.0` or newer. Ensure your `pypim_config.json` correctly sets `"tls": true` and provides necessary certificate paths if applicable (not shown in basic config, consult full docs).
Create a valid JSON configuration file (e.g., `pypim_config.json`) with the PIM API URI. Set the `ANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIG` environment variable to the absolute path of this file before `import ansys.platform.instancemanagement`.
Verify that the PIM API server is running and accessible from your client machine. Double-check the `uri` in your `pypim_config.json` for correctness. Ensure no firewalls are blocking the connection and that TLS settings (`"tls": true/false`) match the server's requirements.
Ensure your code calls `instance.wait_for_ready()` after `client.create_instance()` to block until the instance is fully initialized. Increase any timeouts if the startup process is expected to be long.