Install & Compatibility
Where this runs
tested against v3.2.11 · 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
268MB installed
● package 268MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SCS
✓ from scs import SCS
✗ import scs
solve
✓ from scs import solve
✗ import scs
SOLVED
✓ from scs import SOLVED
✗ import scs
This quickstart solves a simple convex cone program with a non-negative cone. It demonstrates how to prepare the problem data (sparse matrices P, A and dense vectors b, c), define the cone, initialize the SCS solver, and retrieve the solution.
import numpy as np
import scipy.sparse as sp
import scs
# Define problem dimensions
m, n = 4, 2
# Create problem data matrices (P, A as sparse CSC, b, c as numpy arrays)
P = sp.eye(n, format="csc") # Quadratic cost (identity for simplicity)
A = sp.random(m, n, density=0.5, format="csc", random_state=1)
b = np.random.randn(m)
c = np.random.randn(n)
data = {"P": P, "A": A, "b": b, "c": c}
# Define the cone: 'l' for non-negative cone of length m
cone = {"l": m}
# Initialize the SCS solver
solver = scs.SCS(data, cone, verbose=False)
# Solve the problem
sol = solver.solve()
print(f"Solver status: {sol['info']['status']}")
if sol['info']['status'] == 'solved':
print(f"Primal solution (x): {sol['x']}")
print(f"Dual solution (y): {sol['y']}")
Debug
Known issues
gotchaInstalling SCS with optional backends (MKL, GPU) requires specific `pip install -Csetup-args` flags and pre-installed libraries (e.g., MKL, cuDSS, CUDA Toolkit). A standard `pip install scs` will use the default sparse direct solver (QDLDL), which may not be optimal for performance-critical applications.fixConsult the official documentation for detailed installation instructions for desired backends. Ensure all necessary system-level libraries are installed before attempting Python package installation.
affects: 3.x.x and earlier
gotchaProblem data `P` and `A` must be `scipy.sparse.csc_matrix`, and `b` and `c` must be `numpy.ndarray`. While SCS attempts conversion, providing data in the correct format directly avoids potential overhead or unexpected behavior.fixAlways construct `P` and `A` as `scipy.sparse.csc_matrix` and `b`, `c` as 1D `numpy.ndarray` to ensure optimal performance and avoid implicit conversions.
affects: 3.x.x and earlier
gotchaSCS versions before 3.x have experienced compatibility issues with newer NumPy versions, sometimes failing installation or requiring specific NumPy versions to be pre-installed.fixFor new projects, use SCS 3.x or higher, which has improved compatibility. If using older SCS versions, check for `numpy` version requirements in the specific release notes or issues.
affects: <3.0.0
gotchaWarm-starting solutions can significantly improve performance for solving sequences of similar problems, but incorrect use or stale warm-start data can lead to slower convergence or suboptimal results.fixUtilize the `warm_start` parameter in the `solve()` method when solving a series of problems where the current solution is a good approximation of the next. Pass the `sol` dictionary from a previous solve directly, or provide specific `x, y, s` arrays.
affects: All versions
Upgrade
Version history
3.2.11latest on PyPI · released Jan 9, 2026
Audit
Dependencies
numpyrequiredRequired for numerical arrays (b, c vectors).
scipyrequiredRequired for sparse matrices (P, A matrices, specifically CSC format).
mkloptionalOptional for MKL Pardiso direct solver backend.
cudssoptionalOptional for NVIDIA cuDSS GPU direct solver backend.