PyPortfolioOpt is a financial portfolio optimization library for Python, providing methods for mean-variance optimization, Black-Litterman allocation, and risk parity. Version 1.6.0 supports CVXPY-based solvers and offers both classical and objective-based optimization approaches. Release cadence is irregular, with contributions from the community.
pip install pyportfoliooptVerified import paths — ran on the pinned version, not inferred.
Basic mean-variance optimization using historical returns and sample covariance.
Use 'from pypfopt import ...' instead of 'from pyportfolioopt import ...'
Install CVXPY with pip install cvxpy or use the bundled solver (may not work for large problems).
Use methods like `ef.efficient_return(target_return)` directly, not via a constructor parameter.
Use matplotlib directly to plot efficient frontier or weights.