Qiskit / qiskit-ibm-runtime

IBM Client for Qiskit Runtime
https://docs.quantum.ibm.com/api/qiskit-ibm-runtime
Apache License 2.0
136 stars 149 forks source link

JSON Error when retrieving job results #1789

Closed osamarais closed 3 hours ago

osamarais commented 4 days ago

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

kt474 commented 3 days ago

Hi @osamarais, this has been discussed in a previous issue - https://github.com/Qiskit/qiskit-ibm-runtime/issues/1603. I believe the solution here would be to uninstall simplejson from your environment