-
Open a new terminal. Create a new conda environment with Python < 3.8 (Python 3.7 is recommended)
conda create -n modgriddata python=3.7
-
Activate the environment (i.e.,
conda activate modgriddata
) and install the following libraries usingpip
:pip install psutil && pip install matplotlib && pip install pandas && pip install tqdm && pip install sdf && pip install pyyaml && pip install h5py && pip install EMD-signal==1.2.0
-
Clone the GridCal repository for release 4.2.0 or later (important)
-
Activate the conda environment where the installation will be hosted
-
Navigate with a terminal to the GridCal repository folder
-
Inside the GridCal main directory, go to
./src
and run the following commandpython -m pip install . --use-feature=in-tree-build
-
Open a terminal and activate the conda environment where the dependencies and GridCal were set up
-
Run the following command to install
OMPython
pip install -U https://github.com/OpenModelica/OMPython/archive/master.zip
-
Verify the installation by running the following command in a Python terminal
import OMPython
-
Navigate to the directory where the Dymola installation is located and copy the path to the
dymola.egg
file located insideModelica/Libraries
. Below you find two examples of such paths on both Windows and Linux (Ubuntu):C:\Program Files\Dymola 2021\Modelica\Library\python_interface\dymola.egg
/opt/dymola-2021-x86_64/Modelica/Library/python_interface/dymola.egg
-
Identify the folder where the Python installation of the working environment is located. A straightforward way to do so is by running the command
which python
. Locate thesite_packages
subfolder using this path. Two examples are shown below:C:\Users\DeepGrid\.conda\envs\modgriddata\Lib\site-packages
/home/deepgrid/.conda/envs/modgriddata/lib/python3.7/site-packages
-
Create a new file called
python_interface.pth
inside thesite-packages
directory. The contents of the file should be the absolute path to thedymola.egg
file located inside the Dymola installation folder -
Once the file has been created, test the Dymola-Python interface installation by running the following command in a Python terminal
from dymola.dymola_interface import *