Install & Compatibility
Where this runs
tested against v3.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
499MB installed
● package 499MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
pandapower
✓ import pandapower as pp
pandapower.networks
✓ import pandapower.networks as nw
✗ from pandapower import networks
While 'from pandapower import networks' works, aliasing to 'nw' is common for brevity and consistency with 'pp'.
pandapower.plotting
✓ import pandapower.plotting as plot
pandapower.diagnostic.diagnostic
✓ from pandapower.diagnostic import diagnostic
This quickstart creates a simple 3-bus network with an external grid, a transformer, a line, and a load. It then runs a power flow calculation and prints the voltage magnitudes for buses and loading percentages for lines. This demonstrates the basic steps of network creation, power flow execution, and result access.
import pandapower as pp
# Create an empty network
net = pp.create_empty_network()
# Create buses
b1 = pp.create_bus(net, vn_kv=20., name="Bus 1")
b2 = pp.create_bus(net, vn_kv=0.4, name="Bus 2")
b3 = pp.create_bus(net, vn_kv=0.4, name="Bus 3")
# Create external grid (slack bus)
pp.create_ext_grid(net, bus=b1, vm_pu=1.02, name="Grid Connection")
# Create load
pp.create_load(net, bus=b3, p_kw=100, q_kvar=50, name="Load")
# Create transformer (using standard type)
pp.create_transformer_from_parameters(net, sn_kva=400., hv_bus=b1, lv_bus=b2,
vn_hv_kv=20., vn_lv_kv=0.4, vsc_percent=6.,
vscr_percent=1.425, i0_percent=0.3375,
pfe_kw=1.35, name="Trafo")
# Create a line
pp.create_line(net, from_bus=b2, to_bus=b3, length_km=0.1, std_type="NAYY 4x50 SE")
# Run power flow
pp.runpp(net)
# Print results
print("Bus Voltage Magnitude (p.u.):\n", net.res_bus.vm_pu)
print("Line Loading (%):\n", net.res_line.loading_percent)
Debug
Known issues
breakingPlotly plotting functions in pandapower versions >=3.2.0 migrated from Mapbox to MapLibre. This changes internal Plotly trace names (e.g., `scatter_mapbox` to `scatter_map`) and layout properties (`layout.mapbox` to `layout.map`).fixUpdate plotting code to use `*map` trace names and `layout.map` property. Refer to Plotly's MapLibre migration guide and pandapower's updated plotting documentation.
affects: >=3.2.0
breakingIn pandapower versions >=3.2.0, the result parameters for three-phase transformers and lines were fixed for consistency. Specifically, `p_a_l_mw` was renamed to `pl_a_mw` (and similar for other phases and `ql` values).fixAdjust code that accesses `net.res_trafo_3ph` or `net.res_line_3ph` to use the new column names (e.g., `pl_a_mw`, `ql_b_mvar`).
affects: >=3.2.0
breakingpandapower 3.0.0 introduced significant changes to geo data storage, moving from dedicated tables (`net.bus_geodata`, `net.line_geodata`) to `geojson` strings stored directly in the element tables (`net.bus.geo`, `net.line.geo`). Additionally, controller and group parameters were renamed for consistency.fixUpdate code that accesses geo-spatial data or interacts with controllers/groups to reflect the new data structure and parameter names (e.g., `net.bus.geo` instead of `net.bus_geodata`). Refer to the 'Update to pandapower 3.0' guide in the documentation.
affects: >=3.0.0
gotchaUsing SciPy versions incompatible with your Python version can cause installation failures or runtime issues. Specifically, Python 3.10 and pandapower versions around 3.3.x might require `scipy < 1.16`.fixEnsure your `scipy` version is compatible. If encountering issues, try pinning `scipy` to a known working version, e.g., `pip install scipy==1.15.0` or `<1.16` for Python 3.10.
affects: >=3.0.0, especially Python 3.10 users
gotchaBranches (lines, transformers) with zero impedance (e.g., `length_km = 0` for lines or `vk_percent=0` for transformers) will lead to non-converging power flow calculations due to infinite admittances.fixAvoid creating zero-impedance branches. If direct connections without voltage drop are needed, use a `bus-bus` switch instead of a line or transformer with zero impedance.
affects: All versions
Errors
Common errors & fixes
Power flow did not converge!
Various reasons, including network disconnections, invalid input data (e.g., zero impedance branches), missing external grids, or overloaded components.
fixUse the built-in diagnostic function: `from pandapower.diagnostic import diagnostic; diagnostic(net)` to identify common issues. Check for zero impedance branches, ensure an external grid exists, and verify component parameters.
AttributeError: 'pandapowerNet' object has no attribute 'bus_geodata'
Attempting to access old geo data tables (`net.bus_geodata` or `net.line_geodata`) in pandapower versions >=3.0.0 where the geo data structure has changed.
fixAccess geographical data through the `geo` column in the respective element dataframes (e.g., `net.bus.geo`, `net.line.geo`), which now stores geojson strings.
ImportError: cannot import name 'csc_matrix' from 'scipy.sparse'
This error can occur with newer NumPy/SciPy versions due to changes in internal SciPy namespaces, particularly around version 3.4.0 where `scipy.sparse.csc` and `scipy.sparse.csr` were adjusted.
fixUpdate pandapower to the latest version (3.4.0 or newer) which includes fixes for these namespace changes. Ensure compatible SciPy and NumPy versions are installed as per pandapower's requirements.
KeyError: 'mapbox' in plotly plotting or map doesn't render
This typically occurs in pandapower versions >=3.2.0 due to the transition of Plotly plotting from Mapbox to MapLibre. Old 'mapbox' related parameters are no longer recognized.
fixUpdate your plotting calls to use MapLibre-compatible parameters. This includes changing `mapbox_style` to `map_style` and using trace names ending in `_map` instead of `_mapbox`.
Upgrade
Version history
3.4.0latest on PyPI · released Feb 9, 2026
Audit
Dependencies
pythonrequiredRequired Python version
scipyrequiredNumerical routines for power flow, compatibility with Python 3.10 requires <1.16
pandasrequiredCore data structure for networks and results
lightsim2gridoptionalOptional C++ power flow solver
plotlyoptionalInteractive plotting capabilities
networkxoptionalTopological graph searches
lxmloptionalXML parsing for converters (e.g., CIM)