.. _installation: ======================= Installation ======================= WindKit is distributed as both `pypi `__ and `conda `__ packages. However, due to dependencies on several GIS utilities (`GeoPandas `__, `Rasterio `__), which depend on large C based libraries (`GEOS `__, `GDAL `__, `PROJ `__), we recommend installing using the conda packages whenever possible. .. .. note:: If you are installing PyWAsP, which requires a license, you will obtain WindKit through DTU Wind Energy's WAsP Conda Channel instead. Conda installation ------------------ About Conda ^^^^^^^^^^^ Conda is a package manager that is able to use many different sources of packages. WindKit's dependencies require the use of the `conda-forge `__ channel, which is a community effort to provide conda packages for a wide range of software. WindKit itself is currently only distributed through specific DTU Wind Energy channels Instructions ^^^^^^^^^^^^ 1. To install WindKit you need to first install the *conda* package manager. This is done by installing a conda based distribution. We have been using the `Mambaforge `__ distribution with great success, and recommend it, but other Conda based distributions will work as well. 2. After you have installed a conda distribution, you will need to add the DTU Wind Energy Open Conda Channel, and if not using a forge based distribution, you will also need to add the conda-forge channel. The easiest way to do so is via the command prompt. On Linux and macOS, open a terminal that has conda configured. On Windows, you will find an entry called the Anaconda Prompt, which will setup the necessary environment for configuring conda. Run the commands below to add the channels globally so you can use them for all conda environments:: conda config --add channels https://conda.windenergy.dtu.dk/channel/open/ conda config --add channels conda-forge 3. Now you can setup a new conda environment that has WindKit installed. We recommend that you always create a new environment. This helps to prevent the mixing of different channels packages, and allows for easy testing of different versions:: conda create -n windkit This command will find the latest version of all of WindKit's dependencies and install them along with WindKit in an environment named *env_name*. You can add other dependencies as a space-separated list. 4. After creating the new environment, you can change to it using the *conda activate* command:: conda activate Installing with pip ------------------- WindKit can also be installed with pip, by default its plotting dependencies are not included:: pip install windkit To install with plotting dependencies use:: pip install windkit[plots] As noted above, you may run into issues with using the pip installer, please see the installation instructions for `GeoPandas `__ and `Rasterio `__ to find the best installation method for your platform. Dependencies ------------ Required dependencies: - `dtu_config `__ - `geopandas `__ (version 0.8 or later) - `lxml `__ - `netcdf4 `__ - `numpy `__ - `packaging `__ (Provides version handling) - `pandas `__ (version 1 or later) - `pyproj `__ (version 2.2.2 or later) - `rasterio `__ - `rtree `__ - `scipy `__ - `shapely `__ - `xarray `__ Plotting dependencies (optional): - `kaleido `__ (Used to export plotly images to file) - `matplotlib `__ - `plotly `__ Optional dependencies: - `numba `__ (Used to speed up some functions) - `earthengine-api `__ (Google Earth Engine: provides access to geospatial data from google. Non-commercial uses only.) - `planetary-computer `_ (Microsoft Planetary Computer: provides access to geospatial and atmospheric data from Microsoft. Terms of use apply.) - `pystac-client `_ (Used to access SpatioTemporal Asset Catalogs (STAC) data on Microsofts Planetary Computer) - `fsspec `_ (Used for accessing ERA5 data from the Planetary Computer) - `adlfs `_ (Used for accessing ERA5 data from the Planetary Computer)