Installation
The PyWAsP system is distributed through the conda package, dependency, and environment manager via DTU Wind Energy’s WAsP Conda Channel.
Note
Before you can download the software, you will need an access token for the software, and access to the DTU Wind Energy license server.
Currently, PyWAsP can be installed on Linux and Windows systems. However, the windows installation is considered experimental at this stage, so we recommend to install PyWAsP on windows via WSL. In the future we expect full support for installation on Windows and MacOS as well.
Linux
To install PyWAsP on Linux you need to first install conda, this can be done through a number of different installers:
We recommend Miniforge, which we have found to be both reliable and significantly faster. To get and install the latest version, open a terminal and run:
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh bash Miniforge3-Linux-x86_64.shthen follow the instructions and activate the base environment (you may need to re-open the terminal for conda to activate)
Note
Miniforge is a minimal conda installer for conda-forge, which is a community maintained repository of conda packages. It is not affiliated with the conda project. It is however fully compatible with conda and can be used as a drop-in replacement for conda. With Miniforge you have access to both the
conda
andmamba
commands.
After you have installed a conda installer you will need to add the DTU Wind Energy WAsP Conda Channel and the conda-forge channel.
The easiest way to do so is via the command prompt.
Run the commands below to add the channels, replacing the
<user>
and<token>
with the values you obtained with your software license:conda config --add channels conda-forge conda config --add channels https://<user>:<token>@conda.windenergy.dtu.dk/channel/waspNote
The user and token is sent in an email along with your license file after purchase.
Check that the channels have been added by running:
conda config --show channels
You should see the following output:
channels: - conda-forge - https://<user>:<token>@conda.windenergy.dtu.dk/channel/waspIf a “default” channel is listed, you can remove it by running:
conda config --remove channels defaultThis will reduce the risk of conflicts with other packages. If other channels are listed are you see errors in the preceding steps if may be necessary to remove them as well.
Now you can create a new conda environment that includes an installation of PyWAsP:
mamba create -n <env_name> pywasp
Or if you use conda (for example if you did not install Miniforge in step 1):
conda create -n <env_name> pywaspwhere <env_name> is the name of the environment you are creating, e.g. env_pywasp or something else. The command will find all of the dependencies of pywasp and install them along with windkit in the environment.
Note
You can add other packages you need to the
mamba create
call. For example, if you want to use jupyter notebook you should addjupyter
alongsidepywasp
Change to the new environment:
conda activate <env_name>
Open up a Python file or notebook and start using PyWAsP
Type
import pywasp as pw
to import PyWAsP. The first time you do it you will be prompted for the url and port number of your license server. Here you have two options, either to use a local licensing server provided provided by your institution, or thelicense.windenergy.dtu.dk
Server. To learn more about configuring the license see the User ConfigIf you are new to PyWAsP, check out our Tutorials and Examples.
Note
The Python source code and binaries are installed into a folder in the distribution you installed. For example, if you installed Miniforge, the source code is located in
<path>/miniforge/envs/<env_name>
. Where <path> is the path to the folder where you installed Miniforge, and <env_name> is the name of the environment you created in step 4.
Windows via WSL
By installing WSL you will essentially run Linux on Windows and be able to install PyWAsP following the Linux installation guide. To do this, you can:
Install “Windows Subsystem for Linux” via microsoft store
Install a Linux distribution in WSL via microsoft store (we recommend “Ubuntu 20.04”)
Open up a Linux terminal and follow the Linux installation instructions
Windows
To install PyWAsP on Windows you need to first install conda.
You can use any installer listed in the linux installation guide, but we recommend Miniforge.
Go to https://github.com/conda-forge/miniforge and download and run the latest
.exe
installer for windows.Complete the installation using the “default” option and follow the instructions. Then open the “miniforge” prompt which is installed with the miniforge.
(Optional) If you prefer to use powershell, run the command:
conda init powershell
Now open powershell, which should now have an activate conda environment.
Follow step 2 to 5 in the install on linux guide using “miniforge prompt” or “powershell”.
MacOS
Warning
Installation on MacOS is currently not supported. But, look for it in future releases!
Installing a newer version of PyWAsP
The PyWAsP package is updated regularly. To update your installation to the latest version we recommend installing a new environment with the latest version of PyWAsP by following the installation instructions above and giving the new environment a new name.
After installation: running PyWAsP for the first time
When you run PyWAsP for the first time, you will be prompted for the url and port number of your license server. See the User Config for more information.
The first time you write some output to a file using WindKit, you will be prompted for a username and email address. This will be used to write the history attributes to the file.
Note
The first time you import pywasp, it is recommended to do it in a normal python interpreter as doing it in a jupyter notebook has previosuly caused some issues.