Skip to main content

Ansys Python Manager

| 06.29.2023

Simplifying Python Environment Management

 

Python has emerged as a leading programming language because of its flexibility, and its aptitude for a diverse range of applications like data science, machine learning, web development, and workflow automation. It is why we are building our PyAnsys client libraries in Python to enable new solutions for automating engineering workflows, conducting parametric studies, and post-processing simulation results, among many others. One challenge faced when working with Python is configuring Python environments and handling dependencies. This is not always a straightforward process, and can be confusing to newer Python developers in particular. This is why we built Ansys Python Manager, to give Ansys developers an easier way to create and manage their Python environments.

Ansys Python Manager is a collaborative, open-source Python QT application, originally developed by various groups within Ansys and released as open source under the MIT license. This tool gives Ansys developers a lightweight, GUI-driven way to manage Python installations, virtual environments, common Ansys-required Python packages, and PyAnsys package administration.

In this guide, we will demonstrate the various features offered by Ansys Python Manager, including:

  • Python installation
  • Creation and management of virtual environments
  • Initiate Integrated Development Environments (IDEs) & Development environments
  • Package management capabilities including the installation of PyAnsys packages and the management of dependencies
  • Documentation access provided by the Ansys Python Manager and the available options for updating the application.

Installation

To install Ansys Python Manager, you can visit its repository here: Ansys Python Manager repository. Then download the installer (Ansys-Python-Manager-Setup-v*.exe) from the Assets section. After downloading the installer, simply run it, and follow the installation instructions to install Ansys Python Manager on your machine. Once the installation is complete, you can easily launch Ansys Python Manager from the Start Menu.

Install Python Tab

Ansys Python Manager's user interface is where you will manage and configure your Python installations. You can easily select the desired Python version from the provided drop-down menu. The manager provides two options for Python distributions: Standard Python and Condaforge Python. The Standard Python option is the official Python distribution, while the Condaforge Python option uses the community-driven distribution used with products like Anaconda.

After selecting the desired Python version and clicking the "Install" button in Ansys Python Manager, the application will proceed to download and install the chosen Python distribution. Once the installation is finished, Ansys Python Manager will display the installed Python version and its corresponding installation path in the next tab labeled "Create Virtual Environments."

Note: The installation process may take a few minutes to complete, depending on the size of the packages and the internet bandwidth.

Create Virtual Environments Tab

The "Create Virtual Environments" tab in Ansys Python Manager provides the interface for creating and managing virtual environments. You can easily create a virtual environment by selecting the desired Python version and providing a name for your environment. Simply click the Create button to initiate the virtual environment creation process. The Ansys Python Manager will create the virtual environment and display its corresponding path in the subsequent tab labeled "Manage Virtual Environments."

Manage Virtual Environments Tab

The "Manage Virtual Environments" tab in Ansys Python Manager allows you to view and manage the virtual environments you have created. You have options for managing the virtual environment including:

  • Deleting a virtual environment
  • Environment launch options
  • Python package management
  • PyAnsys package management

Delete Environment

This will delete the selected virtual environment and remove the files from the system.

Launch Options

The Launch Options provides the option to launch the selected virtual environment with the available IDEs and development environments. For example, you can launch the Spyder IDE by selecting the virtual environment from the available list and clicking on the Launch Spyder option. Likewise, you can launch Jupyter Notebook, Jupyter Lab and console.

Tip: By using the Launch console option, you can launch the virtual environment via the command prompt and subsequently navigate to the development folder and launch the VS Code IDEs using command line option "code ." You can also set the active interpreter to the chosen virtual environment.

General package management options

In General Package Management options, users are presented with the choice to "install default packages." When selected, the Python installation or virtual environment will receive the most up-to-date, compatible versions of essential packages for working with Ansys tools, such as NumPy, SciPy, Pandas, Matplotlib, and scikit-learn. After the installation process concludes, users can view the list of installed packages by clicking the "List Installed Packages" button. Ansys Python Manager will then display the installed packages in the console, providing an overview of the installed dependencies.

PyAnsys Package Management

The "PyAnsys Package Management" section, allows you to choose the PyAnsys metapackage version to install within the selected Python installation or virtual environment. You can select the desired PyAnsys metapackage version from the available drop-down menu, and install it by clicking the "Install" button. Ansys Python Manager will download and install the PyAnsys metapackage. Individual PyAnsys packages are also available for download.

Note: The installation process may take a few minutes to complete, depending on the size of the packages and the internet bandwidth.

Other Features

To ensure that you have the latest version of Ansys Python Manager, you can easily check for updates by clicking on the "Check for Updates" option located in the File menu. Ansys Python Manager will then verify if a newer version is available and update accordingly if necessary.

In addition, the Ansys Python Manager offers convenient access to the PyAnsys documentation through the Help menu. By selecting your desired PyAnsys project from the provided drop-down menu and clicking on Open Website, user will be redirected to the documentation website specifically to the selected project. This enables you to access comprehensive documentation and resources for your chosen PyAnsys project.

Conclusion

In this guide, we have covered the features offered by Ansys Python Manager. This tool provides a user-friendly interface for Python installation, creation and management of virtual environments, and simplified installation of PyAnsys packages. It also offers multiple options for launching your virtual environment in various development environments or IDEs. Hopefully the ability to graphically manage your Python virtual environments will simplify this task for you, and also speed up your development work with Ansys, PyAnsys, and Python.

References