Install & Compatibility
Where this runs
tested against v0.15.2 · 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
py 3.9
✕ build_error
✓ 14.7s
358MB installed
● package 358MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Location
✓ from pvlib.location import Location
get_solarposition
✓ from pvlib.solar_position import get_solarposition
ModelChain
✓ from pvlib.modelchain import ModelChain
PVSystem
✓ from pvlib.pvsystem import PVSystem
get_total_irradiance
✓ from pvlib.irradiance import get_total_irradiance
This quickstart code defines a geographical location, creates a time series, and then calculates the solar position (zenith, azimuth, etc.) for those times using pvlib's core functionalities. It demonstrates basic usage of `Location` and `get_solarposition`.
import pandas as pd
from pvlib.location import Location
from pvlib.solar_position import get_solarposition
# Define a location (Tucson, Arizona)
tucson = Location(32.2, -110.9, 'US/Arizona', 792, 'Tucson')
# Define time range
times = pd.date_range('2024-01-01 12:00:00', freq='H', periods=3, tz=tucson.tz)
# Get solar position
solpos = get_solarposition(times, tucson.latitude, tucson.longitude)
print(solpos)
Debug
Known issues
breakingSeveral `ModelChain.run_*` methods (e.g., `run_cec_sam`, `run_tmy_data`, `run_poa_cec_inverter`) were removed in v0.14.0. Users should now use the more general `ModelChain.run_model()` method and pass appropriate data structures for inputs.fixMigrate to `ModelChain.run_model()` with explicit data inputs (e.g., `ModelChain.run_model(weather_data)` where `weather_data` contains GHI, DNI, DHI, etc.).
affects: >=0.14.0
breakingThe `pvlib.irradiance.perez` function no longer accepts `dni_extra` or `airmass` as explicit parameters since v0.14.0. These values are now computed internally if not provided through `dni_extra_kwargs` or `airmass_model`.fixRemove `dni_extra` and `airmass` parameters from calls to `pvlib.irradiance.perez`. If custom calculation is needed, supply arguments via `dni_extra_kwargs` or `airmass_model`.
affects: >=0.14.0
breakingThe `wind_speed` parameter was renamed to `temp_air_wind_speed` in `pvlib.temperature.sapm_module` (v0.13.0) and in `pvlib.temperature.pvsyst_cell` (v0.15.0) to improve naming consistency.fixUpdate calls to `pvlib.temperature.sapm_module` and `pvlib.temperature.pvsyst_cell` to use the `temp_air_wind_speed` parameter name instead of `wind_speed`.
affects: >=0.13.0 (sapm_module), >=0.15.0 (pvsyst_cell)
breakingThe `pvlib.singlediode.bishop88_i_from_v` function was removed in v0.13.0, and `pvlib.singlediode.bishop88` (the main function) was deprecated in v0.13.0 and removed in v0.15.0.fixMigrate to alternative single-diode models or other functions within `pvlib.singlediode` (e.g., `pvlib.singlediode.singlediode`).
affects: >=0.13.0 (i_from_v removed, bishop88 deprecated), >=0.15.0 (bishop88 removed)
gotchaSince v0.12.0, `Location.tz` and `PVSystem.tz` attributes now store `pytz.timezone` objects directly instead of string representations of timezones. This can break code that expects a string for timezone checking or serialization.fixAccess the string representation using `.tz.tzname(times[0])` or convert to string if necessary, e.g., `str(location.tz)`.
affects: >=0.12.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pvlib'
The pvlib library or one of its optional dependencies (like pvfactors or statsmodels) is not installed in the active Python environment.
fixEnsure pvlib is installed using `pip install pvlib` or `conda install -c conda-forge pvlib`. If an optional dependency is missing, install it specifically (e.g., `pip install pvlib[optional]` or `pip install pvfactors`).
AttributeError: 'PVSystem' object has no attribute 'racking_model'
This error typically occurs when using code or documentation from a different pvlib version than currently installed, leading to attempts to access attributes or methods that have been renamed, moved, or removed in the current API.
fixCheck your installed pvlib version with `print(pvlib.__version__)` and refer to the corresponding documentation. Updating pvlib to the latest version with `pip install -U pvlib` can resolve issues from outdated examples, but be aware of potential breaking changes.
TypeError: Cannot convert tz-naive Timestamp, use tz_localize to localize
Pandas Timestamps or DatetimeIndexes used in pvlib functions must be timezone-aware to perform timezone conversions (e.g., `tz_convert`). This error indicates an attempt to convert a timezone-naive Series or DataFrame index.
fixLocalize the timezone-naive `DatetimeIndex` or `Timestamp` to an appropriate timezone (e.g., `df.index = df.index.tz_localize('UTC')`) before performing further timezone operations or passing it to pvlib functions that expect localized times. TypeError: sapm() takes 3 positional arguments but 6 were given
A function in pvlib was called with an incorrect number of positional arguments, often due to changes in the function's signature across different pvlib versions or a misunderstanding of the required inputs.
fixConsult the official pvlib documentation for the specific function you are using and your installed version to verify the expected arguments and their order, then adjust your function call to match the documented signature.
Upgrade
Version history
0.15.2latest on PyPI · released Jun 16, 2026
Audit
Dependencies
No dependency data recorded yet.