| description |
|---|
How to install Ems-api and Ems-ui onto your windows machine |
https://pierpuccini.gitbook.io/ems-api/
Note: DigSilents Powerfactory can only be run on a Windows machine. If you happen to be on a Unix based system, there are various virtualization tools in order to get windows setup. In the Help section you'll find some helpful tips with debugging on your unix machine while running the service in Windows.
- Windows 10
- DigSilent 15.1.7 This can be checked by in the menu bar going to Help>About PowerFactory... And at the top you'll find the PowerFactory version.
- Python 3.3.2 This can be checked this by running
pythonin your terminal.- if you don't have this version installed, you can get it from your:
- INSTALLATION_DIRECTORY\DIgSILENT\PowerFactory 15.1\python\python-3.3.2
- Directly from python.org: https://www.python.org/ftp/python/3.3.2/python-3.3.2.msi
- if you don't have this version installed, you can get it from your:
- Pip and setuptools Note: Since python 3.3.2 is no longer suported, Pip and setuptools can no longer be downloaded by tradicional methods e.g. get-pip.py. In order to get pip and setup tools, please follow the steps from: https://stackoverflow.com/questions/56798617/how-to-install-pip-for-python-3-3-on-windows
- For Flask and dependencies run:
pip install Flask Flask-Jsonpify Flask-RESTful
{% hint style="warning" %} If your INSTALLATION_DIRECTORY for PowerFactory is different than C:\Program Files (x86) please correct that path in resources>powerfactory.py on line 7. {% endhint %}
In order to run the app, navigate via CMD to its installation directory and do the following
venv\Scripts\activate
set FLASK_APP=app.py
flask runNow open up the provided url and port and feel free to use the api at your will.
{% hint style="info" %}
In order to change the host and port add -h HOST -p PORT
{% endhint %}