Qiskit/qiskit-ibm-runtime

JSON Error when retrieving job results

osamarais opened this issue · 1 comments

Describe the bug
JSON error when running on real backend:

File "/lib/python3.12/site-packages/simplejson/init.py", line 533, in loads
return cls(encoding=encoding, **kw).decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.12/site-packages/qiskit_ibm_runtime/utils/json.py", line 331, in init
super().init(object_hook=self.object_hook, *args, **kwargs)
TypeError: JSONDecoder.init() got an unexpected keyword argument 'encoding'

Steps to reproduce
Submit a job and get the results from real backend
result = estimator.run([(ansatz, hamiltonian, [params])]).result()

Expected behavior
Should return job data without an error.

Suggested solutions
Simply replacing
import json
with
import simplejson as json
in qiskit_ibm_runtime/utils/json.py
fixes this particular issue.

Additional Information

  • qiskit-ibm-runtime version: 0.23.0
  • Python version: 3.12.3
  • Operating system: Ubuntu 24.04 LTS Linux 6.8.0-36-generic x86-64

Hi @osamarais, this has been discussed in a previous issue - #1603. I believe the solution here would be to uninstall simplejson from your environment