Five optimization/allocation libraries for after-work notebooks — skfolio 1.0.3, PyPortfolioOpt 1.6.0, Riskfolio-Lib 7.3.0, CVXPY 1.9.2, cvxportfolio 1.5.1. Separate from risk/vol metrics listicle. Not a fake ranking. Not investment advice.
Five libraries you can pip on a weeknight to practice allocation / optimization maths in a notebook — not a live trading product. This list is separate from our top-5 Python portfolio risk / volatility packages listicle (metrics ≠ optimizers). Versions pinned from PyPI around Hub date 7 Sep 2026. Not a search-volume ranking and not investment advice.
The only course CTA is Introduction to Python Programming.
skfolio docs · PyPI skfolio. Fit/predict-style API familiar if you already live in scikit-learn pipelines. Pin 1.0.3 (PyPI check ~Sep 2026).
pip install "skfolio==1.0.3"
pyportfolioopt.readthedocs.io · PyPI PyPortfolioOpt. Efficient frontier helpers, common objectives/constraints, good first textbook loop. Pin 1.6.0.
pip install "PyPortfolioOpt==1.6.0"
riskfolio-lib.readthedocs.io · PyPI riskfolio-lib. Broad catalogue of risk measures / portfolio models on top of CVXPY + Pandas. Pin 7.3.0 (2026 line).
pip install "riskfolio-lib==7.3.0"
cvxpy.org · PyPI cvxpy. Not a “portfolio app” — the modelling language many of the above sit on. Learn weights-as-variables + constraints once. Pin 1.9.2.
pip install "cvxpy==1.9.2"
cvxportfolio docs / GitHub · PyPI cvxportfolio. Policy + simulator style for multi-period experiments (still educational, not a broker). Pin 1.5.1.
pip install "cvxportfolio==1.5.1"
# Educational only. Synthetic returns. Not investment advice. Not a trading signal.
import numpy as np
import cvxpy as cp
rng = np.random.default_rng(0)
R = rng.normal(0.001, 0.02, size=(60, 4)) # T x n fake returns
mu = R.mean(axis=0)
Sigma = np.cov(R, rowvar=False)
w = cp.Variable(4)
objective = cp.Maximize(mu @ w - 0.5 * cp.quad_form(w, Sigma))
constraints = [cp.sum(w) == 1, w >= 0]
prob = cp.Problem(objective, constraints)
prob.solve(solver=cp.SCS)
print("status:", prob.status)
print("weights:", np.round(w.value, 4))
Stop after one package. Do not wire a broker or “signals” product tonight.
If Python packaging is the blocker, Introduction to Python Programming, then pip install one of the five and print its version.