TC-Python: Configuring a License
TC-Python requires a license to run. If you do not yet have the information about your license, contact Thermo-Calc Support at support@thermocalc.com.
If you have no valid license, an exception is thrown that states: NO LICENSE: No activated license for TC-Python
.
Depending on the type of license, different steps are required to configure TC-Python to use it.
Environment Variables
Some environment variables need to be set. On Windows this is normally done during the installation of Thermo-Calc, but on Linux and macOS this needs to be performed for each used IDE or terminal.
TC-Python: Setting Environment Variables
License Activation with User Credentials
This section is applicable to licenses that are activated after entering user credentials (i.e. user name and password).
The TC-Python license is a separate license from the Thermo-Calc software license. You need to activate the TC‑Python license once on your computer after, or in addition to, activating the Thermo-Calc license.
It is recommended to run the included example to perform the activation and deactivation. By default an online activation is performed, but you can choose other methods, which are both included in the example and described in the API documentation.
- Open and run the example
pyex_M_04_license.py
, which is located in the Miscellaneous folder. - The license activation is completed with the methods in the class
tc_python.license.LicenseManager
. - Depending on the type of license other methods are available, for example for online and offline activation plus the use of proxy settings are described.
Once the license is activated, either by using online or offline activation methods, you can view the license status and information in Thermo-Calc. Select Help → Show License Info from the menu.
To use the license on a different computer, the license must first be deactivated on the original computer. This is for both online and offline activations.