Installation#
To use the locally-installable version of ThermoEngine, you will first need to install it using pip. The instructions below will walk you through the installation process.
Currently, ThermoEngine requires the use of Python 3.10. This is most easily achieved by creating a virtual environment using Conda. You can check whether you have Conda installed by going to your Terminal and entering the following command:
conda --version
If you do not have Conda installed, we recommend downloading the MiniForge installer: https://conda-forge.org/download/. If you already have Conda installed via Anaconda or Miniconda and are using Windows, use Anaconda/Miniconda Prompt instead of MiniForge Prompt in the steps below.
To create a new virtual environment using Conda, open your Terminal (Mac/Linux) or the MiniForge Prompt (Windows) and enter the following code:
conda create -n enki python=3.10
This creates a virtual environment named “enki” where you can run ThermoEngine using Python 3.10 without changing your default Python version or settings. Any time you wish to use this virtual environment, you can do so by entering the following code into the Terminal/MiniForge Prompt:
conda activate enki
Once you have activated the environment, you will see the text “(enki)” before your command line prompt.
The next step is to install the ThermoEngine package. You can do this from your enki environment using the following command:
pip install thermoengine
Once you have installed the package, you can access its modules from your enki environment. To test your installation, open Python from the command line:
python3
If you have created your virtual environment correctly, you should now have Python 3.10.xx enabled. From here, you can import the package with the following command:
>>> import thermoengine
At this point, you should see a UserWarning about the ThermoEngineLite module. This is fine! You can now test the installation by importing a module:
>>> from thermoengine import magmaforge
If everything has been installed correctly, this should run without errors.
After Installation#
If you wish to use the model from the command line, you will need to ensure your “enki” environment is active each time you wish to use the model. If you don’t see (enki) in your command line prompt, you can re-activate the virtual environment with the same activation command:
conda activate enki
If you use an IDE, you will need to ensure that you activate your virtual environment in the IDE before importing the ThermoEngine package into a project. This process varies based on the IDE. We recommend searching the internet for “<Your_IDE> activate conda environment”.
If you don’t already have an IDE and/or are relatively new to programming, we recommend using JupyterLab to use the ThermoEngine package. Instructions for using ThermoEngine with JupyterLab are shown on the next page.