Installation
System Requirements
- Python: 3.7+ (3.9 recommended)
- Operating System: Windows, macOS, or Linux
- Windows recommended for full functionality with PSS®E (Windows‑only)
- Git: Required to clone the repository
Power System Software (optional)
- PSS®E: Version 34 or later (commercial, Windows‑only)
- PyPSA: Installed via WEC‑Grid dependencies
WEC Modeling Software (optional)
- MATLAB: R2021b (tested)
- WEC‑Sim: https://wec-sim.github.io/WEC-Sim/main/user/getting_started.html
Choose Your OS
Use the tabs below to get tailored steps for your platform and environment manager.
- Clone the repo
- Create and activate env
- Upgrade pip
- Install WEC‑Grid
- Optional extras
- Verify
- Clone the repo
- Create and activate env
- Upgrade pip
- Install WEC‑Grid
-
Optional extras (same as above)
-
Verify
- Clone the repo
- Create and activate env
- Upgrade pip
- Install WEC‑Grid
-
Optional extras (same as above)
-
Verify
- Clone the repo
- Create and activate env
- Upgrade pip
- Install WEC‑Grid
- Optional extras
- Verify
- Clone the repo
- Create and activate env
- Upgrade pip
- Install WEC‑Grid
-
Optional extras (same as above)
-
Verify
- Clone the repo
- Create and activate env
- Upgrade pip
- Install WEC‑Grid
- Optional extras
- Verify
- Install venv if needed
- Clone the repo
- Create and activate env
- Upgrade pip
- Install WEC‑Grid
-
Optional extras (same as above)
-
Verify
Notes
- If python=3.9
is unavailable on your default conda channels, try: conda create -n wecgrid_env -c conda-forge python=3.9
.
- On Linux, using conda is often simpler for scientific Python stacks with native libs.
WEC‑Sim / MATLAB Setup (Optional)
- Install MATLAB (R2021b recommended/tested).
- Install WEC‑Sim: https://wec-sim.github.io/WEC-Sim/main/user/getting_started.html
- Install the MATLAB Engine API for Python into your active environment:
- Official guide: https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
- Typical flow (with env activated):
PSS®E Setup (Windows only)
- Install PSS®E (commercial license).
- Ensure your Python version matches your PSS®E version (see below).
- Make PSS®E’s Python API importable. Easiest path is the helper:
- If needed, manually configure env vars/PATH per Siemens docs or community guides, e.g.: https://psspy.org/psse-help-forum/question/122/how-do-i-import-the-psspy-module-in-a-python-script/
Common issue
- “Bad magic number” when importing psspy
usually indicates a Python version mismatch: https://psspy.org/psse-help-forum/question/9494/im-trying-to-use-psspy-and-always-i-get-the-same-error-bad-magic-number-in-psspy-bx03xf3rn-someone-can-help-me-to-fix-this-error/
PSS®E ↔ Python compatibility (typical) - PSS®E 32: Python 2.5 (32‑bit) - PSS®E 33: Python 2.7 (32‑bit) - PSS®E 34: Python 2.7 / 3.4 / 3.7 (32‑bit) - PSS®E 35: Python 3.9 (64‑bit)
Troubleshooting
- Always upgrade
pip
inside your env:python -m pip install --upgrade pip
. - If pip builds fail on Linux/macOS, prefer conda to avoid compiler issues.
- On Debian/Ubuntu, if
python3 -m venv
fails, install:sudo apt-get install python3-venv
. - Quick verification:
python -c "import wecgrid; print(wecgrid.__version__)"
.