symengine
Python library providing wrappers to SymEngine
What it is and what it does
SymEngine is a Python wrapper around a fast C++ symbolic algebra engine. It provides core symbolic computation capabilities—variable definition, expression expansion, simplification, and algebraic manipulation—without requiring a full computer algebra system. The library is designed for speed and is used where symbolic operations need to be integrated into Python workflows without the overhead of heavier systems.
The package ships pre-built wheels for Python 3.9–3.13 across macOS, Linux, and Windows, reducing install friction for most users. Building from source is possible but requires CMake, the SymEngine C++ library itself, and Cython. Optional dependencies like NumPy and SymPy can enhance functionality. The wrapper is actively maintained and carries no known security vulnerabilities.
Use it for:
- Expand and simplify algebraic expressions symbolically in mathematical or physics simulations.
- Integrate symbolic computation into performance-critical Python code where speed matters.
- Define symbolic variables and perform algebraic operations in numerical computing pipelines.
- Evaluate floating-point expressions via lambdify when linked against LLVM.
- Use as a faster alternative to SymPy for core symbolic manipulation tasks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python wrappers for SymEngine, a fast C++ symbolic manipulation library, enabling symbolic computation and algebraic operations in Python.
Yes, if you need fast symbolic computation in Python and can accept medium install friction. Pre-built wheels make installation straightforward for Python 3.9–3.13 on common platforms. The MIT license and active maintenance are favorable. No security vulnerabilities are known. Consider it especially if performance of symbolic operations is a bottleneck; otherwise, SymPy may be simpler if speed is not critical.
Install
symengine on PyPI
pip
pip install symengineuv
uv add symenginepoetry
poetry add symengineInstalling symengine
Before you install
Medium install friction due to compiled C++ dependencies. Pre-built wheels are available for Python 3.9–3.13 on macOS, Linux (x86_64, aarch64, ppc64le), and Windows. Building from source requires CMake ≥ 3.21, SymEngine ≥ 0.14.0, and Cython ≥ 0.29.24. Package is actively maintained with recent commits.
License in practice
MIT-licensed wrapper using LGPL-3.0-or-later (GMP, MPFR, MPC, MPIR), Apache-2.0 (LLVM), BSD-3-Clause (zstd, symengine), and Zlib dependencies in wheels. Permissive overall, but LGPL dependencies require awareness of linking obligations if redistributing binaries.
Quickstart
pip install symengine
from symengine import var
x, y, z = var('x y z')
e = (x + y + z)**2
expanded_e = e.expand()
print(expanded_e)
Requires Python ≥ 3.9 and < 4. Pre-built wheels available for common platforms; building from source requires CMake ≥ 3.21 and SymEngine ≥ 0.14.0.
Verify before relying
- Whether LLVM linking is recommended or required for typical lambdify use cases.
- Performance comparison with SymPy or other symbolic libraries for common operations.
- Whether FLINT linking is available in pre-built wheels or requires source build.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4,>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 480 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 506,365/month — #6,286 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: symengine-0.14.1-cp310-cp310-macosx_10_13_x86_64.whl; symengine-0.14.1-cp310-cp310-macosx_11_0_arm64.whl; symengine-0.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; symengine-0.14.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; symengine-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; symengine-0.14.1-cp310-cp310-win_amd64.whl; symengine-0.14.1-cp311-abi3-macosx_10_13_x86_64.whl; symengine-0.14.1-cp311-abi3-macosx_11_0_arm64.whl; symengine-0.14.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; symengine-0.14.1-cp311-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl; symengine-0.14.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; symengine-0.14.1-cp311-abi3-win_amd64.whl; symengine-0.14.1-cp311-cp311-macosx_10_13_x86_64.whl; symengine-0.14.1-cp311-cp311-macosx_11_0_arm64.whl; symengine-0.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; symengine-0.14.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; symengine-0.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; symengine-0.14.1-cp311-cp311-win_amd64.whl; symengine-0.14.1-cp312-cp312-macosx_10_13_x86_64.whl; symengine-0.14.1-cp312-cp312-macosx_11_0_arm64.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
cppyy-clingProvides Cling, an LLVM-based interactive C++…
copyleft · top 15,000 on PyPI
cypari2cypari2 provides a Python interface to PARI/GP,…
copyleft · top 15,000 on PyPI
TheanoTheano is a Python library for defining,…
permissive · top 15,000 on PyPI
passagemath-categoriesProvides Sage categories, basic rings,…
copyleft · top 15,000 on PyPI
Theano-PyMCTheano-PyMC is an optimizing compiler for…
permissive · top 15,000 on PyPI
casadiCasADi is a framework for algorithmic…
copyleft · top 5,000 on PyPI
onemkl-sycl-blasProvides optimized C and Data Parallel C++…
unclear · top 15,000 on PyPI
constantlyProvides symbolic constant support in Python,…
permissive · top 5,000 on PyPI
passagemath-objectsProvides a foundational object system,…
copyleft · top 15,000 on PyPI