Closed osamarais closed 3 hours 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.
import json
import simplejson as json
Additional Information
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
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
withimport simplejson as json
in qiskit_ibm_runtime/utils/json.py fixes this particular issue.Additional Information