Installation
Install swmmx from PyPI, then install the scientific packages used by the workflows you plan to run. The package intentionally keeps third-party scientific dependencies lightweight so it does not unexpectedly reshape an existing engineering Python environment.
python -m pip install swmmx
Runtime Scientific Dependencies
python -m pip install numpy pandas matplotlib networkx
Optional GIS Dependencies
GIS import and export lazily require GeoPandas and Shapely.
python -m pip install geopandas shapely
Optional Excel Dependency
python -m pip install openpyxl
Native SWMM Engines
| Platform | Engine behavior |
|---|---|
| Windows 64-bit | Bundled swmm5.dll. |
| Linux 64-bit | Bundled libswmm5.so. |
| macOS | Bundled libswmm5.dylib. |
from swmmx import swmm
m = swmm("model.inp", custom_dll_path="/path/to/swmm5")
m.run()
Troubleshooting
| Symptom | Likely fix |
|---|---|
| Missing NumPy, pandas, matplotlib, or NetworkX | Install the runtime dependencies above in the active environment. |
| SWMM engine not found | Use a supported bundled platform or pass custom_dll_path. |
| GIS import/export dependency error | Install geopandas and shapely. |
| Excel export dependency error | Install openpyxl. |
| Plot window does not appear | Check the matplotlib backend, or call plotting functions with show=False and save_path=.... |