Installation#
PyWAsP is distributed via DTU Wind Energy’s WAsP Conda Channel and requires a license to run. It supports Python 3.12, 3.13 and 3.14.
Platform Support#
Platform |
Status |
Notes |
|---|---|---|
Linux / WSL |
Supported |
Recommended platform |
Windows |
Supported |
|
macOS (Apple Silicon) |
Experimental |
|
macOS (Intel) |
Not supported |
Prerequisites#
Before installing, ensure you have:
You need a PyWAsP license and access credentials (username and token) from DTU Wind Energy. These are provided in your license email.
PyWAsP requires network access to the DTU license server for license validation. Ensure outbound HTTPS connections are allowed.
Quick Install#
For experienced users, here are the essential commands:
pixi auth login conda.windenergy.dtu.dk --username <user> --password <token>
pixi init && pixi project channel add https://conda.windenergy.dtu.dk/channel/wasp
pixi add pywasp
mamba auth login conda.windenergy.dtu.dk --username <user> --password <token>
mamba create -n pywasp -c https://conda.windenergy.dtu.dk/channel/wasp -c conda-forge pywasp
mamba activate pywasp
Replace <user> and <token> with your credentials from the license email.
The auth login command stores them once; later installs and updates reuse them.
Detailed Installation#
Pixi is a modern, fast package manager for project-based dependency management.
Step 1: Install pixi
Follow the instructions at pixi.sh.
Step 2: Store your channel credentials
pixi auth login conda.windenergy.dtu.dk --username <user> --password <token>
Pixi stores the credentials and uses them for every channel on that host from now on.
Step 3: Create a project
mkdir my-pywasp-project
cd my-pywasp-project
pixi init
Step 4: Add the WAsP channel and install PyWAsP
pixi project channel add https://conda.windenergy.dtu.dk/channel/wasp
pixi add pywasp
Because the channel URL carries no credentials, pixi.toml is safe
to commit and share.
Step 5: Verify installation
pixi run python -c "import pywasp; print(pywasp.__version__)"
To work interactively, use pixi shell to enter the environment.
Step 1: Install a package manager
We recommend Miniforge,
which provides mamba version 2 or newer. The mamba auth command
used below requires mamba 2; check with mamba --version.
Linux:
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh
macOS (Apple Silicon):
curl -LO https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh
Follow the prompts and restart your terminal.
Note
Windows users
Download and run the latest Windows installer from
Miniforge releases.
Use the default options, then open Miniforge Prompt from the Start menu.
To use PowerShell instead, run conda init powershell and restart PowerShell.
Step 2: Store your channel credentials
mamba auth login conda.windenergy.dtu.dk --username <user> --password <token>
Mamba stores the credentials and uses them for every channel on that host from now on.
Step 3: Create environment and install PyWAsP
mamba create -n pywasp -c https://conda.windenergy.dtu.dk/channel/wasp -c conda-forge pywasp
Step 4: Activate and verify
mamba activate pywasp
python -c "import pywasp; print(pywasp.__version__)"
Post-Installation Setup#
Run these commands from an activated pywasp environment.
Configure your license
The interactive configuration sets up your license and your download preferences:
pywasp configure
Download the global mesoclimate files
The air density, baroclinicity and stability functions need the global mesoclimate: long-term mean atmospheric fields from the ERA5 and CFSR reanalyses, shipped as a few NetCDF files. Fetch them now:
pywasp mesoclimate download
Importing PyWAsP never downloads anything. If you skip this step, the files
are fetched the first time a function needs them, following the download
settings in your configuration: with download_prompt
on, a y/n prompt when there is a terminal to ask in; otherwise, including with
the settings pywasp configure suggests, an automatic download. Running
pywasp mesoclimate download up front avoids that first-use pause, and is the way to prepare a container image
or a machine without a terminal. pywasp mesoclimate status lists the files
and pywasp mesoclimate path prints where they live. See
Download options for the details and
Manually downloading the mesoclimate files if you have no
internet access.
Check license status
To view your license status and remaining runs:
pywasp status
See User Config for more details.
Updating PyWAsP#
pixi update
We recommend creating a new environment for major updates:
mamba create -n pywasp_new -c https://conda.windenergy.dtu.dk/channel/wasp -c conda-forge pywasp
Troubleshooting#
Import errors
ModuleNotFoundError: No module named ‘pywasp’
Ensure your environment is activated:
mamba activate pywasp # or: pixi shell
ImportError: DLL load failed (Windows)
Try reinstalling in a fresh environment:
mamba create -n pywasp_fresh -c https://conda.windenergy.dtu.dk/channel/wasp -c conda-forge pywasp
License errors
LicenseError: No valid license found
Configure PyWAsP with your license:
pywasp configureCheck remaining runs:
pywasp statusVerify network access to the license server.
LicenseError: License server connection failed
Check firewall settings and ensure outbound HTTPS is allowed.
Channel authentication errors
HTTP 401 Unauthorized when fetching from conda.windenergy.dtu.dk
The stored credentials are missing or wrong. Remove them and log in again with the username and token from your license email:
pixi auth logout conda.windenergy.dtu.dk
pixi auth login conda.windenergy.dtu.dk --username <user> --password <token>
mamba auth logout conda.windenergy.dtu.dk
mamba auth login conda.windenergy.dtu.dk --username <user> --password <token>
Use the same two commands to rotate to a new token.
auth command not found
mamba auth login requires mamba 2 or newer; check with
mamba --version. The reliable upgrade is a fresh install of the latest
Miniforge. Alternatively,
update mamba in place from your base environment using classic conda,
since mamba 1.x cannot always replace itself while running:
conda update -n base mamba
Solver error “python … does not exist (perhaps a missing channel)”
The WAsP channel only hosts PyWAsP and WindKit; everything else comes from conda-forge. A mamba install with no default channel configuration sees only the WAsP channel and cannot find Python. Add conda-forge explicitly, as in the install commands above:
mamba create -n pywasp -c https://conda.windenergy.dtu.dk/channel/wasp -c conda-forge pywasp
SSL certificate errors (corporate networks)
If you see SSL: CERTIFICATE_VERIFY_FAILED or license server trust errors,
your network may use a custom Certificate Authority.
Get the CA certificate (
.pemfile) from your IT administratorFind your PyWAsP config file:
import pywasp pywasp.user_config.get_config_filepath()
Add to the
[licensing]section:root_ca_filepath = /path/to/your/ca-certificate.pem
See User Config for more details. You can also run
pywasp configure and set the root_ca_filepath when prompted.
Downloading the global mesoclimate files fails
The global mesoclimate files for baroclinicity, stability and air density
calculations are fetched by pywasp mesoclimate download, or on first use
of a function that needs them. If the download fails (e.g., firewall
restrictions, no internet), PyWAsP raises MesoclimateMissingError and
you can download and install the files manually.
Get the files from Zenodo and place them in the directory printed by
pywasp mesoclimate path.
See Manually downloading the mesoclimate files for download links and file locations.
Dependencies#
PyWAsP depends on WindKit and includes all WindKit dependencies plus additional packages for WAsP modelling.
Required dependencies
geopandas (1.0+) - Spatial data handling
lxml (5.2+) - XML processing
matplotlib (3.9+) - Plotting
netcdf4 (1.7+) - NetCDF file I/O
numba (0.59+) - JIT compilation for faster functions
numpy (2.0+) - Numerical arrays
pandas (2.3+) - Data structures
platformdirs (4.3+) - Platform directories
py-wake (2.6.10 - 2.6.12) - Wake modelling
pydantic (2.7+) - Data validation
pydantic-settings (2.3+) - Settings management
pyproj (3.7+) - Coordinate transforms
pyyaml (6+) - YAML parsing
rasterio (1.4+) - Raster I/O
requests - HTTP client
scipy (1.13+) - Scientific computing
shapely (2.0+) - Geometric operations
toml - TOML parsing
tqdm (4+) - Progress bars
windkit (2.2+) - Wind data I/O, spatial operations and plotting (brings rioxarray, h5netcdf, packaging, …)
xarray (2024.9+) - Labeled arrays
Need Help?#
If you encounter issues not covered here:
Visit the WAsP Forum
Email us at pywasp@dtu.dk
See also
User Config - Configure PyWAsP settings
Quick Overview - Get started with PyWAsP
Tutorials - Step-by-step guides