Using ThermoEngine with JupyterLab (Optional)#
Once you have successfully installed the ThermoEngine package locally, you can run the code using any standard Python IDE, such as VS Code or PyCharm. If you are relatively new to programming, we recommend using JupyterLab (https://jupyterlab.readthedocs.io/en/latest/), which allows the user to build Jupyter notebooks, which intersperse code and text in a user-friendly environment. Our gallery notebooks can all be downloaded as Jupyter notebooks.
If you have Conda installed via MiniForge, you will have to install JupyterLab (see below). The steps here demonstrate how to install JupyterLab and activate your “enki” virtual environment in a Jupyter notebook.
1. Install JupyterLab#
First, ensure that your enki environment is activated. Go to your Terminal (Mac/Linux) or MiniForge Prompt (Windows) and enter the command:
conda activate enki
Install JupyterLab: (if you have Conda installed via Anaconda rather than MiniForge, you may not need to do this step)
conda install jupyterlab
Once installed, the easiest way to access Jupyter Lab is from the command line. Open your Terminal/MiniForge Prompt and enter the following command:
jupyter-lab
This should launch the Jupyter Lab interface in a web browser window.
2. Install IPyKernel in your virtual environment#
In Terminal/MiniForge Prompt, install the IPyKernel package into your environment:
conda install ipykernel
Register the environment with Jupyter:
python -m ipykernel install --user --name=enki --display-name "Python (enki)"
3. Select your environment in Jupyter#
Now, you can return to JupyterLab. In the main Launcher window to the right, you should see the ability to create a new Notebook using your Python (enki) environment.
If you create a notebook using this environment, you should be able to import the Thermoengine package:
>>> import thermoengine
Any time you create or open a Jupyter notebook, you will be able to select your enki environment. The environment is shown in the upper right of the notebook, and should say Python (enki).
4. Run ThermoEngine!#
Now you are ready to run code using ThermoEngine. You can either start from scratch, or you can download any file from the Gallery as a notebook (.ipynb). Happy modeling!