Install & Compatibility
Where this runs
tested against v7.1.1.post1 · 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
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.6s · import 0.018s · 237MB
235MB installed
● package 235MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
PySSC
✓ import PySAM.PySSC as PySSC
✗ import PySSC
PySSC is a submodule of PySAM
Pvwattsv8
✓ import PySAM.Pvwattsv8 as Pvwattsv8
✗ import Pvwattsv8
Modules are nested under PySAM package
Battery
✓ from PySAM.Battery import Battery
✗ from PySAM.Battery import Battery as BatteryModel
Class name matches module name, collision avoided via direct import
CustomGeneration
✓ from PySAM.CustomGeneration import CustomGeneration
✗ import PySAM.CustomGeneration
Must import the class, not just the module
Run a default PVWatts simulation and print annual energy. Replace 'file.csv' with a solar resource file.
import PySAM.Pvwattsv8 as pv
# Create default system
system_model = pv.default('FlatPlatePV-NoSDK')
# Modify parameters
system_model.SolarResource.solar_resource_file = 'file.csv'
system_model.execute()
print(system_model.Outputs.annual_energy)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'PySAM'
Package not installed or installed as 'nrel-pysam' but import as 'PySAM' (case-sensitive).
fixRun `pip install nrel-pysam` and ensure import uses capital 'P' and 'S': `import PySAM`.
AttributeError: 'PySSC' object has no attribute 'execute'
Direct call to PySSC object instead of a module (e.g., Pvwattsv8) that has execute().
fixCreate a module via default() or new() and call execute on that module, not on PySSC.
TypeError: 'NoneType' object is not subscriptable
Accessing outputs before calling execute().
fixEnsure `system_model.execute()` is called before accessing `system_model.Outputs`.
KeyError: 'solar_resource_file'
Trying to assign to an input using legacy string-based method like `module.value('solar_resource_file', 'path')` which is no longer supported.
fixUse proper attribute access: `module.SolarResource.solar_resource_file = 'path'`.
Upgrade
Version history
7.1.1.post1latest on PyPI · released Apr 28, 2026
Audit
Dependencies
numpyrequiredNumerical arrays for input/output
pandasrequiredDataFrames for multi-year outputs
NsightoptionalGPU acceleration for certain modules (e.g., photovoltaic)