{"id":24390,"library":"pyroots","title":"pyroots","description":"Pure Python single-variable function solvers. Provides root-finding algorithms such as bisection, Newton-Raphson, secant, and others. Current version: 0.5.0. Release cadence is low (last release 2021).","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/pmav99/pyroots","tags":["root-finding","numerical-methods","scipy-alternative"],"install":[{"cmd":"pip install pyroots","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"bisection","correct":"from pyroots import bisection"},{"note":"","wrong":"","symbol":"newton","correct":"from pyroots import newton"},{"note":"","wrong":"","symbol":"secant","correct":"from pyroots import secant"},{"note":"","wrong":"","symbol":"ridders","correct":"from pyroots import ridders"},{"note":"","wrong":"","symbol":"brent","correct":"from pyroots import brent"}],"quickstart":{"code":"from pyroots import bisection\n\ndef f(x):\n    return x**3 - 2*x - 5\n\nroot = bisection(f, 2, 3)\nprint(f\"Root: {root:.6f}\")","lang":"python","description":"Find a root of f(x)=x^3 - 2x -5 in interval [2,3] using bisection."},"warnings":[{"fix":"Use 'from pyroots import bisection' instead.","message":"The 'methods' submodule (e.g., from pyroots.methods import bisection) is deprecated; use top-level imports (from pyroots import bisection).","severity":"deprecated","affected_versions":"<=0.4.0"},{"fix":"Ensure your function f(x) returns a single float, not a list or numpy array.","message":"All solvers require a function that returns a scalar; they do not support vectorized functions or arrays. Passing a vector will fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Read docstring of each solver to confirm tolerance behavior.","message":"Flexible tolerance 'xtol' behavior: bisection uses 'xtol' as absolute tolerance; newton uses 'xtol' for step size. Inconsistent across methods – check source if expecting identical semantics.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Python >=3.6.","message":"Support for Python 2.7 and 3.5 is deprecated; future releases may drop it.","severity":"deprecated","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from pyroots import bisection' instead.","cause":"The submodule 'methods' was removed in version 0.5.0.","error":"ModuleNotFoundError: No module named 'pyroots.methods'"},{"fix":"Ensure your function f(x) returns a single float, not an array.","cause":"Passing a numpy array or list as the function argument where a scalar is expected.","error":"TypeError: only length-1 arrays can be converted to Python scalars"},{"fix":"Choose an interval [a, b] such that f(a)*f(b) < 0.","cause":"Bisection and bracket-based methods require the function to change sign over the interval.","error":"ValueError: f(a) and f(b) must have opposite signs"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}