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.
Recommended Installation
We strongly recommend using a modern, fast package manager from the conda ecosystem like mamba or pixi. These tools provide significant speed improvements and better dependency resolution compared to the classic conda client.
Using Mamba (via Miniforge)
Mamba is a fast, drop-in replacement for conda. We recommend installing it via the Miniforge installers, which pre-configure the essential conda-forge channel.
Install Miniforge. Follow the instructions on their GitHub page.
2. Create an environment and install WindKit. Create a new, isolated environment for your project. This is a best practice to avoid dependency conflicts.
The following command will create an environment named wk-env
with WindKit, explicitly using the required channels.
mamba create -n wk-env windkit -c https://conda.windenergy.dtu.dk/channel/open/ -c conda-forge
Activate the environment.
mamba activate wk-envNote
If you prefer to configure channels globally first, you can run the following commands and then omit the
-c
flags from themamba create
command.mamba config --add channels https://conda.windenergy.dtu.dk/channel/open/ mamba config --add channels conda-forge
Using Pixi
Pixi is a modern project and package manager built on the conda ecosystem. It uses a pixi.toml
file to manage project dependencies,
similar to pyproject.toml
, and is great for creating reproducible project environments.
Install Pixi. Follow the official installation guide.
Initialize a new project. In your project directory, run:
pixi init
Add WindKit as a dependency. This command adds the required channels and the WindKit package to your
pixi.toml
file and installs it into the project’s environment.
pixi add --channel https://conda.windenergy.dtu.dk/channel/open/ --channel conda-forge windkit
Use the environment. You can now run commands within the managed environment. For example, to start a Python interpreter or run a script:
pixi run python pixi run python my_script.py
To open a shell within the activated environment, run pixi shell
.
Legacy Conda Installation
If you prefer to use the classic conda client, you can follow these steps. Note that dependency resolution may be significantly slower.
Install a conda distribution. If you don’t have one, we recommend Miniforge.
Configure channels. Open a conda-enabled terminal (e.g., “Anaconda Prompt” on Windows) and add the necessary channels.
conda config --add channels https://conda.windenergy.dtu.dk/channel/open/ conda config --add channels conda-forge
Create an environment.
conda create -n <env_name> windkit
Activate the environment.
conda activate <env_name>
Alternative: PyPI Installation
Warning
Installing WindKit from PyPI using pip
, uv
, or other package managers can be significantly more complex than using conda.
This is because PyPI installers do not manage the non-Python, C-based libraries that WindKit’s dependencies (like GeoPandas and Rasterio) rely on
(e.g., GDAL, GEOS, PROJ).
You are responsible for installing these system-level dependencies yourself before installing WindKit. For this reason, we strongly recommend the conda-based installation methods for a much smoother experience.
If you are an experienced user and have the necessary system libraries installed, you can use a PyPI-based installer. It is essential to always work within a virtual environment.
Using pip
This is the standard approach using pip.
Install WindKit. To install the base package:
pip install windkit
To include optional dependencies:
pip install windkit[plots,data_apis,performance]
Note
We recommend using a virtual environment to avoid conflicts with other Python packages. You can create one using venv or virtualenv.
Using uv
uv is an extremely fast Python package installer and resolver, designed as a drop-in replacement for pip
and venv
.
Install uv. Follow the official installation guide.
Create and activate a virtual environment.
uv
can create and manage virtual environments.# Create the virtual environment uv venv # Activate the environment (same as with venv) # On macOS/Linux source .venv/bin/activate # On Windows .venv\Scripts\activate
Install WindKit. Use
uv pip
to install packages into the activated environment.To install the base package:
uv pip install windkit
To include optional dependencies:
uv pip install windkit[plots,data_apis,performance]
Dependencies
Required dependencies:
- Plotting dependencies (optional:
plotting
): kaleido (Used to export plotly images to file)
- Data API dependencies (optional:
data_api
): 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)
- Performance dependecies (optionaL:
performance
): numba (Used to speed up some functions)