You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
solver.status_name() raises TypeError: 'ortools.sat.python.cp_model_helper.CpSolverStatus' object is not callable #4985
./build/python/venv/bin/python ortools/sat/samples/binpacking_problem_sat_hacked.py
Traceback (most recent call last):
File "ortools/sat/samples/binpacking_problem_sat.py", line 82, in <module>
binpacking_problem_sat()
~~~~~~~~~~~~~~~~~~~~~~^^
File "ortools/sat/samples/binpacking_problem_sat.py", line 72, in binpacking_problem_sat
print(f"solve status 1: {solver.status_name()}")
~~~~~~~~~~~~~~~~~~^^
File "build/python/venv/lib/python3.13/site-packages/ortools/sat/python/cp_model.py", line 1955, in status_name
status = self._checked_response.status()
TypeError: 'ortools.sat.python.cp_model_helper.CpSolverStatus' object is not callable
To Fix, you can modify locally your site-packages/ortools/sat/python/cp_model.py
note: you can use python3 -m pip show ortools to find location
diff -u ortools/sat/python/cp_model.py build/python/venv/lib/python3.13/site-packages/ortools/sat/python/cp_model.py--- ortools/sat/python/cp_model.py 2026-01-05 12:48:19.952391675 +0100+++ build/python/venv/lib/python3.13/site-packages/ortools/sat/python/cp_model.py 2026-01-15 11:18:00.654856848 +0100@@ -1952,7 +1952,7 @@
def status_name(self, status: Optional[Any] = None) -> str:
"""Returns the name of the status returned by solve()."""
if status is None:
- status = self._checked_response.status()+ status = self._checked_response.status
return status.name
def solution_info(self) -> str:
Activity
Mizux commentedon Jan 15, 2026
Confirmed using any sat sample: ortools/sat/samples/binpacking_problem_sat.py and changing it.
workaround use the "old" version:
devNote:
Mizux commentedon Jan 15, 2026
same issue on main:
trace:
Mizux commentedon Jan 15, 2026
To Fix, you can modify locally your
site-packages/ortools/sat/python/cp_model.pynote: you can use
python3 -m pip show ortoolsto find locationfix: fix workaround for bug in ortools issue 4985
fix: final workaround for bug in ortools issue 4985