Mosek
Python API for Mosek
What it is and what it does
MOSEK is a commercial optimization solver that handles a wide range of convex and mixed-integer problems through a Python interface. It supports linear programs (LP), quadratic programs (QP), second-order cone programs (SOCP), exponential and power cone problems, semidefinite programs (SDP), quadratically constrained quadratic programs (QCQP), and mixed-integer programs (MIP). The package wraps a compiled solver engine and requires numpy as its only runtime dependency.
Typically used in research, finance, engineering, and machine learning workflows where problem scale or numerical precision demands a commercial-grade solver. Requires Python 3.9 or later and a valid license (free trial and academic licenses available). Installation pulls precompiled binaries for common platforms, avoiding compilation overhead.
Use it for:
- Portfolio optimization and risk management in quantitative finance
- Large-scale machine learning problems requiring conic relaxations or semidefinite programming
- Engineering design optimization with convex constraints
- Operations research and resource allocation problems
- Academic research in convex optimization and mathematical programming
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
MOSEK solves large-scale convex and mixed-integer optimization problems including linear, quadratic, conic, and semidefinite programs via a Python API.
Yes, if you have a convex or mixed-integer optimization problem at scale and can obtain a MOSEK license (free trial available). The solver is mature, actively maintained, and supports a broad problem class. No, if you need an open-source solver or cannot accept the licensing requirement. Verify license terms for your use case before committing.
Install
mosek on PyPI
pip
pip install mosekuv
uv add mosekpoetry
poetry add mosekInstalling Mosek
Before you install
Medium install friction due to compiled binary wheels for multiple platforms (macOS ARM64, Linux x86_64 and aarch64, Windows x64). Active maintenance with a release 65 days ago. Single runtime dependency on numpy.
License in practice
License treatment is unclear; MOSEK requires a paid license, though trial and non-commercial academic licenses are available from the vendor. Verify licensing terms before production deployment.
Quickstart
pip install mosek
import mosek
import numpy as np
# Requires valid MOSEK license; see https://www.mosek.com for trial/academic options
MOSEK requires a valid license (free trial and academic licenses available at https://www.mosek.com). Python 3.9 or later required.
Verify before relying
- Whether trial or academic licenses are sufficient for your intended use case
- Performance characteristics and solver quality relative to open-source alternatives
- Support and SLA terms included with different license tiers
Package facts
| License | https://mosek.com/products/license-agreement (unclear) |
| Python support | supports the current Python release (<3.15,>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 65 days since the last release |
| First released | |
| Downloads | 430,486/month — #6,726 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mosek-11.2.2-cp39-abi3-macosx_11_0_arm64.whl; mosek-11.2.2-cp39-abi3-manylinux2014_x86_64.whl; mosek-11.2.2-cp39-abi3-manylinux_2_27_aarch64.whl; mosek-11.2.2-cp39-abi3-win_amd64.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
cvxoptcvxopt is a Python library for solving convex…
unclear · top 5,000 on PyPI
scsscs is a Python interface to the Splitting…
permissive · top 5,000 on PyPI
clarabelClarabel is an interior-point conic…
permissive · top 5,000 on PyPI
ecosECOS is a Python wrapper for a numerical solver…
copyleft · top 5,000 on PyPI
daqpDAQP is a dual active-set solver for convex…
permissive · top 15,000 on PyPI
gekkoGEKKO is a Python package for optimization and…
permissive · top 15,000 on PyPI
highspyHighspy is a Python wrapper around HiGHS, a…
permissive · top 5,000 on PyPI
qpsolversProvides a unified Python interface to solve…
copyleft · top 5,000 on PyPI
xpressPython interface to the FICO Xpress Optimizer…
unclear · top 15,000 on PyPI
osqpOSQP is a Python wrapper for the Operator…
permissive · top 5,000 on PyPI