Install package in development mode#

This topic assumes that you want to install PyAnsys Geometry in developer mode so that you can modify the source and enhance it. You can install PyAnsys Geometry from PyPI or from the PyAnsys Geometry repository on GitHub.

Package dependencies#

PyAnsys Geometry is supported on Python version 3.9 and later. As indicated in the Moving to require Python 3 statement, previous versions of Python are no longer supported.

PyAnsys Geometry dependencies are automatically checked when packages are installed. These projects are required dependencies for PyAnsys Geometry:

  • ansys-api-geometry: Used for supplying gRPC code generated from Protobuf (PROTO) files

  • NumPy: Used for data array access

  • Pint: Used for measurement units

  • PyVista: Used for interactive 3D plotting

  • SciPy: Used for geometric transformations

PyPI#

Before installing PyAnsys Geometry, to ensure that you have the latest version of pip, run this command:

python -m pip install -U pip

Then, to install PyAnsys Geometry, run this command:

python -m pip install ansys-geometry-core

GitHub#

To install the latest release from the PyAnsys Geometry repository on GitHub, run these commands:

git clone https://github.com/ansys/pyansys-geometry
cd pyansys-geometry
pip install -e .

To verify your development installation, run this command:

tox

Install in offline mode#

If you lack an internet connection on your installation machine (or you do not have access to the private Ansys PyPI packages repository), you should install PyAnsys Geometry by downloading the wheelhouse archive for your corresponding machine architecture from the repository’s Releases page.

Each wheelhouse archive contains all the Python wheels necessary to install PyAnsys Geometry from scratch on Windows, Linux, and MacOS from Python 3.9 to 3.12. You can install this on an isolated system with a fresh Python installation or on a virtual environment.

For example, on Linux with Python 3.9, unzip the wheelhouse archive and install it with these commands:

unzip ansys-geometry-core-v0.5.4-wheelhouse-Linux-3.9.zip wheelhouse
pip install ansys-geometry-core -f wheelhouse --no-index --upgrade --ignore-installed

If you are on Windows with Python 3.9, unzip the wheelhouse archive to a wheelhouse directory and then install using the same pip install command as in the preceding example.

Consider installing using a virtual environment. For more information, see Creation of virtual environments in the Python documentation.

Verify your installation#

Verify the Modeler() connection with this code:

>>> from ansys.geometry.core import Modeler
>>> modeler = Modeler()
>>> print(modeler)

Ansys Geometry Modeler (0x205c5c17d90)

Ansys Geometry Modeler Client (0x205c5c16e00)
Target:     localhost:652
Connection: Healthy

If you see a response from the server, you can start using PyAnsys Geometry as a service. For more information on PyAnsys Geometry usage, see User guide.

Go to Getting started