CoolProp is an open-source thermophysical property database that provides functions to calculate thermodynamic and transport properties of various fluids, including refrigerants, pure fluids, pseudo-pure fluids, and humid air. It offers functionality similar to commercial software like REFPROP but is free and open-source. The library currently ships as version 7.2.0 and sees regular releases with performance improvements, bug fixes, and support for newer Python versions.
Install & Compatibility
Where this runs
tested against v7.2.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
muslpy 3.10–3.925 runs
build_error
glibcpy 3.10–3.925 runs
installs and imports cleanly · install 3.8s · import 1.005s · 98MB
99MB installed
● package 99MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CP
✓ import CoolProp.CoolProp as CP
Standard import for accessing most core CoolProp functions, like PropsSI.
PropsSI
✓ from CoolProp.CoolProp import PropsSI
Direct import for the high-level SI unit interface function.
HAPropsSI
✓ from CoolProp.HumidAirProp import HAPropsSI
For calculating humid air properties.
This quickstart demonstrates how to use the `PropsSI` function from the CoolProp library to calculate the density of CO2 and the saturated vapor enthalpy of R134a. Inputs are provided in SI units, and outputs are also in SI units.
import CoolProp.CoolProp as CP
# Get density of carbon dioxide at 100 bar and 25 degrees C
density = CP.PropsSI('D', 'T', 298.15, 'P', 100e5, 'CO2')
print(f"Density of CO2: {density:.2f} kg/m^3")
# Get saturated vapor enthalpy of R134a at 25 degrees C
enthalpy = CP.PropsSI('H', 'T', 298.15, 'Q', 1, 'R134a')
print(f"Saturated vapor enthalpy of R134a: {enthalpy:.2f} J/kg")
CoolProp --version
Debug
Known issues
breakingCoolProp v7.0.0 introduced significant changes, including new superancillary functions for pure fluids and a revised Equation of State (EOS) for methanol to align with REFPROP. These changes can lead to different numerical results for properties calculated using previous versions.fixReview your code and calculations, especially for methanol properties or where high precision for ancillary functions is critical, to ensure compatibility with the updated models.
affects: >=7.0.0
deprecatedThe n-dimensional input functionality for Python was removed in CoolProp v6.4.1 due to an excessive number of bugs. Attempting to use this feature will likely result in errors.fixAvoid using n-dimensional inputs; ensure your code passes scalar values or uses appropriate iteration/vectorization outside of CoolProp's direct calls if parallel calculations are needed.
affects: >=6.4.1
gotchaIntegrating with the commercial REFPROP library requires setting specific configuration variables (`ALTERNATIVE_REFPROP_PATH` or `ALTERNATIVE_REFPROP_LIBRARY_PATH`) to point to your REFPROP installation. Failure to correctly set these paths will prevent CoolProp from using REFPROP's backend and can lead to `ValueError` exceptions.fixSet the REFPROP path using `CoolProp.set_config_string(CoolProp.ALTERNATIVE_REFPROP_PATH, 'C:\path\to\REFPROP')` early in your script. Note that REFPROP is a separate, paid product.
affects: All versions supporting REFPROP integration
gotchaHistorically, some users encountered installation issues (e.g., `ERROR: Command errored out with exit status 1`) with `pip install CoolProp` on certain Python versions (e.g., 3.8, 3.9) due to build system complexities.fixEnsure your `pip` is up-to-date (`pip install --upgrade pip`). If issues persist, try `pip install Cython` first, or consult the CoolProp documentation for manual build instructions. Version 7.2.0 updated the build system to `scikit-build-core` for better reliability.
affects: <7.2.0 (especially 3.8-3.9)
gotchaCoolProp can issue non-fatal warning messages via Python's `warnings` module for improper function usage or deprecated features. These can be verbose.fixThe best solution is to correct the underlying code causing the warning. If necessary for debugging, you can suppress these warnings using Python's `warnings` module, e.g., `import warnings; warnings.filterwarnings('ignore', category=UserWarning)`. affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'CoolProp'
This error occurs when the CoolProp library is not installed in the Python environment.
fixInstall CoolProp using pip: `pip install CoolProp`.
TypeError: expected bytes, str found
This error arises due to compatibility issues between CoolProp and Python 3.12.
fixDowngrade Python to version 3.11 or manually build CoolProp for Python 3.12.
ImportError: cannot import name 'PropsSI' from 'CoolProp.CoolProp'
This error occurs when attempting to import 'PropsSI' incorrectly from CoolProp.
fixUse the correct import statement: `from CoolProp.CoolProp import PropsSI`.
ValueError: No outputs were able to be calculated.
The input parameters provided to a CoolProp function like `PropsSI` define a state point that is physically impossible, outside the valid range for the specified fluid, or lead to a numerical solver failure within the library.
fixVerify that your input values (e.g., temperature, pressure, quality) are physically realistic and within the documented range for the fluid. Review the fluid's phase diagram and CoolProp's documentation for valid input combinations.
ValueError: Invalid key
The string used for a fluid name, property key, or input pair (e.g., 'T', 'P', 'Water') in a CoolProp function call is misspelled, incorrect, or not recognized by the library.
fixConsult the CoolProp documentation (specifically the `PropsSI` function details) for the exact and case-sensitive string representations of fluid names and property inputs. Examples include 'T' for temperature, 'P' for pressure, 'Water', 'R134a'.
Audit
Dependencies
pythonrequiredRequired for the Python wrapper.