Install & Compatibility
Where this runs
tested against v1.11.0 · 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
py 3.9
✕ build_error
✕ build_error
95MB installed
● package 95MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
latex2sympy
✓ from latex2sympy2_extended import latex2sympy
✗ from latex2sympy2 import latex2sympy
Ensure you import from 'latex2sympy2_extended' and not the older 'latex2sympy2' or 'latex2sympy' packages.
This quickstart demonstrates how to import the `latex2sympy` function and use it to convert a common LaTeX derivative expression into its SymPy equivalent.
from latex2sympy2_extended import latex2sympy
# Define a LaTeX expression for a derivative
tex_expression = r"\frac{d}{dx}(x^{2}+x)"
# Convert the LaTeX expression to a SymPy expression
sympy_expression = latex2sympy(tex_expression)
print(sympy_expression)
# Expected output: Derivative(x**2 + x, x)
Debug
Known issues
breakingThe library is not compatible with Python 3.13 due to the removal of 'typing.io'. It requires Python 3.12 or below.fixUse Python 3.12 or an earlier version until compatibility is officially added.
affects: All versions with Python 3.13+
deprecatedThe `latex2sympy2_extended.math_normalization.equations` module/functionality is deprecated as its handling is now integrated directly into the parser.fixRemove direct calls to `math_normalization.equations` and rely on the parser's built-in handling.
affects: Versions 1.0.9 and later (as reported in Feb 2025)
gotchaWhen converting certain linear algebra expressions (e.g., determinants, transposed matrices, elementary transformations), the conversion process may involve irreversible calculations, meaning the resulting SymPy expression might not be algebraically identical to the original if interpreted purely symbolically.fixBe aware of this limitation and verify results for complex linear algebra operations.
affects: All versions
gotchaComma-separated numbers are only supported in standalone forms (e.g., '1,233') and not within expressions (e.g., '1,233x').fixEnsure that comma-separated numbers are used as standalone values or reformatted before passing to the parser if they are part of a larger expression.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'typing.io'
The `latex2sympy2-extended` library, or its `antlr4-python3-runtime` dependency, is not compatible with Python 3.13 because the `typing.io` module was removed in that Python version.
fixUse Python 3.12 or an earlier version.
from latex2sympy2 import latex2sympy
Users attempting to use `latex2sympy2-extended` might mistakenly import from the older `latex2sympy2` package.
fixChange the import statement to `from latex2sympy2_extended import latex2sympy`.
pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. latex2sympy2-extended X.Y.Z requires antlr4-python3-runtime==A.B.C, but you have antlr4-python3-runtime D.E.F which is incompatible.
There is a version conflict with the `antlr4-python3-runtime` dependency, often because other installed packages require a different version.
fixInstall `latex2sympy2-extended` specifying a compatible ANTLR4 runtime version, for example, `pip install latex2sympy2_extended[antlr4_13_2]`.
WARNING - latex2sympy2_extended.math_normalization - equations is deprecated, as it handled by the parser now
The `latex2sympy2_extended.math_normalization.equations` module/functionality is deprecated because its handling is now integrated directly into the parser.
fixRemove direct calls to `math_normalization.equations` and rely on the parser's built-in handling.
ModuleNotFoundError: No module named 'latex2sympy2_extended'
The 'latex2sympy2-extended' library is not installed in your current Python environment.
fixpip install latex2sympy2-extended
Upgrade
Version history
1.11.0latest on PyPI · released Jan 10, 2026
Audit
Dependencies
sympyrequiredCore dependency for symbolic mathematics.
antlr4-python3-runtimerequiredUsed for parsing LaTeX expressions, specific runtime versions (e.g., 4.9.3, 4.11.0, 4.13.2) can be specified during installation.