This wiki serves as the central point for customers to access the most up-to-date information regarding the switch to Python 3. It will be updated as more information becomes available. This content may change at any time without notice. You can use the "Subscribe to content activities" option form the drop-down in the upper right to be notified when edits are made.
Background
Since being released with Abaqus/CAE in 1999, the Abaqus Python scripting interface has been a powerful tool for automating simulation processes and building complex functionality around the class-leading nonlinear mechanics capabilities of the Abaqus finite element solvers. To ensure this interface continues to deliver the best experience to our customers, Abaqus Python will be upgraded to version 3.10.5 with the Abaqus 2024x GA release. With this upgrade, we’ll enable our customers and partners to leverage recent functionality provided in Python 3 and ensure that Abaqus uses scripting interfaces that are broadly and actively supported in the development community.
Changes in Python 3
The original release of Python 3 introduced a number of changes which broke backwards-compatibility with existing Python 2 code. The most obvious change was related to the functionalization of the print command, but many other features changed as well. As a result, scripts originally written with Python 2 syntax generally do not run in Python 3 without modification, although in most cases it’s possible to modify scripts so that they will run in both Python 2.7 and Python 3.
Some examples of Code Differences between Python 2 and Python 3
Impacts
Because of the break in backwards compatibility, many existing Abaqus Python scripts and plugins written with Python 2.7 syntax will need to be modified to run correctly after the update to Python 3 is made. Therefore, we expect this update to impact many customers and partners who use Abaqus Python. For this reason, we're communicating about this update ahead of its release.
Impacted Functionalities
This is a summary (not comprehensive) of Abaqus functionalities that are impacted by the change to Python 3.
- Abaqus/CAE and Abaqus/Viewer scripting
- Scripts are impacted
- Plugins are impacted
- Custom Applications are impacted
- Note - .rpy and .jnl files, as well as macros, should be cross-compatible as these files exclusively access the Abaqus/CAE APIs, which are not affected by the upgrade to Python 3 (i.e., the module interfaces associated with accessing mdb and odb objects, as well as Abaqus/CAE functionality, are not changing due to the Python 3 upgrade).
- Standalone Abaqus Python scripts (e.g., scripts run with abaqus python myscript.py)
- The abaqus_v6.env file is interpreted using Abauqs Python. If it contains syntax that is incompatible with Python 3, Abaqus 2024 will fail with a Python error.
- Data lines for the *PARAMETER keyword are interpreted using Abaqus Python. *PARAMETER supports a subset of Python syntax, but integer division in particular behaves differently between Python 2 and 3.
- Parametric Studies (.psf files)
- Batch scheduling scripts (scripts provided by DS via QA00000008056 are being updated to be compatible with Python 3)
Information about the update
Timeline
The Python 3 update will be included in Abaqus 2024x GA, which is scheduled for release in late 2023.
Details about the update
- The version of Python in 2024x GA will be 3.10.5.
- It will not be possible to run Abaqus Python 2.7.15 with the Abaqus release that includes the update to Python 3.10.5.
- A conversion utility will be provided as part of the update.
- While this utility will catch many common syntax changes and is likely to successfully convert many scripts, due to the number of changes that are made in Python 3 and the open-ended nature of Python scripts it isn't possible to automatically convert every instance of Python 2.7 code that must be modified for Python 3.
Converting Your Scripts
The following wiki article discusses some about the upgrade utility and some commonly encountered upgrade issues.
How to Prepare
There are several measures that customers can take now to prepare for the this update.
- If you haven't yet, familiarize yourself with the changes made in Python 3 (this page on the Python website gives a helpful overview).
- Examine your scripts and consider whether they can be made "Python 3 ready."
- If writing new scripts, use syntax that is compatible with Python 3.
- Subscribe to this wiki post to be notified when additional information is added.
Disclaimer
BY ACCESSING THIS WIKI (“WIKI”) YOU AGREE TO THE FOLLOWING TERMS:
THE CONTENT IN THIS WIKI IS MADE AVAILABLE ON AN "AS IS" BASIS WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, ORAL OR WRITTEN, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT.
DASSAULT SYSTEMES SIMULIA CORP., ANY OF ITS AFFILIATES (COLLECTIVELY “DS”), AND ITS LICENSORS SHALL HAVE NO LIABILITY FOR DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, INCLUDING WITHOUT LIMITATION CLAIMS FOR LOST PROFITS, BUSINESS INTERRUPTION AND LOSS OF DATA, THAT IN ANY WAY RELATE TO THE CONTENT IN THIS WIKI, WHETHER OR NOT DS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY REMEDY.
YOUR USE OF ANY CONTENT IN THIS WIKI SHALL BE AT YOUR SOLE RISK.