Python Guidance
The Ansys Orbit Determination Tool Kit (ODTK®) application version 13.1 requires Python version 3.9 or later.
The scripts supplied with the ODTK application install require the following Python modules:
- h5py
- more_itertools
- numPy
- packaging
- pandas
- pyparsing
- python-dateutil
- pytz
- pywin 32
- setuptools
- six
- tzdata
Many of the modules are installed by default with common Python distributions.
Ansys has tested ODTK application version 13.0 with Python version 3.13.5. The ODTK application will display a warning if your Python version is past end of life, outside of the range of supported versions listed on the Python website.
This topic provides guidance for the following:
- Installing Python (from the STK_ODTK install or on your own)
- Module mapping
- Running Python scriptlets
- Changing Python settings
Installing Python
You can choose to install Python from the ODTK distribution media (recommended) or you can install it yourself outside of ODTK installation.
Installing Python from the ODTK distribution media
For your convenience, ODTK distribution media contains a Python folder that has an open-source, free Python installer from python.org as well as a set of third-party modules necessary to generate all reports. Follow these steps to install Python software from the ODTK distribution media:
- In your ODTK installation distribution media, go to the Python folder.
- Install the Python bundle using python-3.13.x-amd64.exe, preferably making it available to all users.
- Add the Python install path to the system PATH environment variable. The ODTK application does not know where Python is installed on the computer. It is relying on the standard file path resolution processes to find the "python" executable.
- Verify that you installed the proper version of Python. Open a Command Prompt and run the following command: python --version. If it responds back with "Python 3.x.y" (or something similar), then things are ready to go. If it's not working and you update your PATH environment variable to fix it, you have to open a new Command Prompt. The old one does not requery the environment variables to get the new value of PATH. If you are still having trouble resolving the path to your Python executable, you can try setting the environment variable PYTHONHOME.
- Return to the Python folder in the ODTK installation media. Run InstallModules.cmd to install additional Python modules required to run the ODTK application.
- You must verify that your Python installation meets the necessary package requirements by generating a report containing the Python version, installed Python packages, and any environment variables that you set. You can do this in one of the following ways:
- Run the report style "Python Environment" in the Static Product Builder within the ODTK application.
- Open a Windows Command Prompt and run the following command:python "C:\Program Files\AGI\STK_ODTK 13\ODTK\AppData\PythonReport\odtk_python_debug.py" --h5file "" --outfile reportOutput.txt
- (Optional) To use Python Tracking Data plugins, you must pip install the Python API WHL file.
The wheel file is included with the STK install in the bin/AgPythonAPI directory.
This WHL file install is not required for any ODTK application functionality other than for Python plugins.
Using pip may require an SSL certification. Please contact your system administration to provide this file.
python -m pip install "C:\Program Files\AGI\STK_ODTK 13\bin\AgPythonAPI\agi_odtk13-13.1-py3-none-any.whl"To ensure a working development setup, run a simple program that exercises the API. In a Python file, copy and paste the code below and run it to verify that the Python package has installed successfully.
[Python - ODTK API] import agi.odtk13
Setting PYTHONHOME is no longer required for Tracking Data plugins.
Install Python outside of the ODTK application
You can install Python on your own outside of the ODTK application. You must verify that your Python installation meets the necessary package requirements. After you finish the installation of Python, perform steps 3 and 4 above. After installing the additional Python modules, execute step 6 above.
Python plugin module mapping
The following table provides the corresponding library for each Python plugin module.
| Library | Module |
|---|---|
|
agi.odtk13.plugins.attrautomation |
|
| HPOP | agi.odtk13.plugins.hpopplugin |
| Plugin Site Interfaces | agi.odtk13.plugins.odtkplugin |
| Tracking Data | agi.odtk13.plugins.trackingdata |
| Utilities Library | agi.odtk13.plugins.utplugin |
Running Python scriptlets
To run Filter and Simulator .Event.*OnEvent* scriptlets written in Python, you have to:
- Install the Python for Windows Extension (PyWin32) module.
- Register Python extensions by running "python <Python-install-dir>\Lib\site-packages\win32comext\axscript\client\pyscript.py".
Ansys includes the third-party module PyWin32*.whl with the ODTK installation.
Changing Python settings
You can change Python checking and settings within the ODTK application by selecting Edit - Preferences and clicking Python Settings.