TC-Python Installation Guide: Thermo-Calc Version 2021b
TC-Python Installation Guide: Thermo-Calc Version 2021b
The TC-Python help is available on the Thermo-Calc website where you can also
access additional resources. You can alternatively access the locally installed
documentation from the Help menu in Thermo-Calc.
You can also navigate to the Manuals folder outside of Thermo-Calc and
based on your operating system installation location.
3. Double-click the Index HTML file (or any of the HTML files).
4. The API reference documentation opens as a searchable HTML file in your local
browser.
See the Videos about TC-Python page for additional learning resources.
The bundled interpreter package is also used to run the Property Models in
Thermo-Calc. Do not make changes to interpreter packages or this can stop
Thermo-Calc from working correctly. To fix issues caused by changes to an
interpreter, completely uninstall Thermo-Calc and start over, either with the
bundled interpreter package or using interpreters of your choice.
Limitations
The bundled Python 3.7.2 interpreter contains the following major packages.
Package Version
matplotlib 3.3.2
numpy 1.19.2
scikit-learn 0.23.2
Package Version
scipy 1.5.2
TC-Python 2021b
For Mac installations, you also need to set some environment variables as
described below in "macOS: Setting Environment Variables" on page 14.
3. Click on the settings symbol close to the Project Interpreter dropdown menu and
choose Add.
4. Select System Interpreter and add the bundled Thermo-Calc Python 3 interpreter,
Operating
Path to the bundled Python-interpreter
system
Linux /home/UserName/Thermo-Calc/2021b/python/bin/python3
macOS /Applications/Thermo-Calc-2021b.app/Contents/Resources/python/bin/python3
When you first open the TC-Python project and examples, it can take a few
moments for the Pycharm IDE to index before some of the options are available.
1. Open PyCharm and then choose File → Open. The first time you open the project
you will need to navigate to the path of the TC-Python installation based on your
operating system.
2. Click the Examples folder and then click OK.
3. From any subfolder:
l Double-click to open an example file to examine the code.
l Right-click an example and choose Run.
If you are not following the recommended approach and create a new project
(File→New Project…), you need to consider that by default the options to
choose the interpreter are hidden within the Create Project window. For this,
click Project Interpreter: New Virtual Environment and in most cases choose
your System Interpreter containing the Python bundled to Thermo-Calc instead
of the default New Virtual Environment.
If you are new to TC-Python and want to mainly run the examples, then it is
recommended you install the bundled Python-interpreter. The available
preinstalled packages (e.g. numpy, scipy, scikit-learn, and matplotlib) can also
be sufficient for many advanced users. See "Installing TC-Python with a Bundled
Python-interpreter" on page 5.
If you already have a Python distribution installation, version 3.5 or higher, skip
this step.
These instructions are based on using the Anaconda platform for the Python distribution.
Install version 3.5 or higher to be able to work with TC-Python, although it is recommended
that you use the most recent version.
Install Anaconda
Operating
Path to the TC-Python folder
system
Windows C:\Users\UserName\Documents\Thermo-Calc\2021b\SDK\TC-Python
Linux /home/UserName/Thermo-Calc/2021b/SDK/TC-Python
Operating
Path to the TC-Python folder
system
macOS /Users/Shared/Thermo-Calc/2021b/SDK/TC-Python
On Windows, it is recommended you use the Anaconda distribution prompt (i.e. Anaconda),
especially if you have other Python installations.
Do not use Virtual Environments unless you have a good reason to do so. Also
see "Fixing Potential Issues with the Environment" on page 15.
1. Open the command line. For example, in Anaconda on a Windows OS, go to Start →
Anaconda → Anaconda Prompt.
2. At the command line, enter the following. Make sure there are no spaces at the end
of the string or in the folder name or it will not run:
pip install <path to the TC-Python folder>/TC_Python-<version>-
py3-none-any.whl
For Mac installations, you also need to set some environment variables as
described below in "macOS: Setting Environment Variables" on page 14.
When you first open the TC-Python project and examples, it can take a few
moments for the Pycharm IDE to index before some of the options are available.
1. Open PyCharm and then choose File → Open. The first time you open the project
you will need to navigate to the path of the TC-Python installation based on your
operating system.
2. Click the Examples folder and then click OK.
3. From any subfolder:
l Double-click to open an example file to examine the code.
l Right-click an example and choose Run.
Operating
Path to the TC-Python folder
system
Windows C:\Users\UserName\Documents\Thermo-Calc\2021b\SDK\TC-Python
Linux /home/UserName/Thermo-Calc/2021b/SDK/TC-Python
macOS /Users/Shared/Thermo-Calc/2021b/SDK/TC-Python
For a bundled Python-interpreter installation, these are the paths to this location based on
your operating system.
Operating
Path to the bundled Python-interpreter
system
Linux /home/UserName/Thermo-Calc/2021b/python/bin/python3
macOS /Applications/Thermo-Calc-2021b.app/Contents/Resources/python/bin/python3
These steps are required if you have previously followed the instructions in
"Installing TC-Python Into a Python-interpreter of Your Choice" on page 8.
When updating to a newer version of Thermo-Calc, you always need to also install the latest
version of TC-Python. It is not sufficient to run the installer of Thermo-Calc (except for
bundled versions of the Python interpreter).
pip install <path to the TC-Python folder>/TC_Python-<version>-py3-
none-any.whl
In case of problems you may wish to uninstall the previous version of TC-Python in advance:
pip uninstall TC-Python
pip install <path to the TC-Python folder>/TC_Python-<version>-py3-
none-any.whl
If you are not following the recommended approach and create a new project
(File→New Project…), you need to consider that by default the options to
choose the interpreter are hidden within the Create Project window. For this,
click Project Interpreter: New Virtual Environment and in most cases choose
your System Interpreter containing the Python bundled to Thermo-Calc instead
of the default New Virtual Environment.
It is important to run the diagnostic script EXACTLY the same way as you run
your TC-Python script (in the same IDE, same project, same Python
environment, same Jupyter notebook, etc).
The script automatically prints useful suggestions that, in many cases, will help you to fix the
problem yourself. If you are unable to solve the problem, contact us for support. You can
find the script in these locations: