Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing config files for fake backends on qiskit_ibm_runtime.fake_provider #1318

Closed
mrvee-qC-bee opened this issue Jan 17, 2024 · 5 comments · Fixed by #1319
Closed

Missing config files for fake backends on qiskit_ibm_runtime.fake_provider #1318

mrvee-qC-bee opened this issue Jan 17, 2024 · 5 comments · Fixed by #1319
Labels
bug Something isn't working
Milestone

Comments

@mrvee-qC-bee
Copy link
Contributor

Describe the bug
FileNotFound error while calling a fake backend from qiskit_ibm_runtime.fake_provider

Steps to reproduce

from qiskit import QuantumCircuit
from qiskit import transpile
from qiskit_ibm_runtime.fake_provider import FakeManilaV2

# Get a fake backend from the fake provider
backend = FakeManilaV2()

Expected behavior
backend variable should initialise successfully without error

Additional Information

Traceback (most recent call last):
  Cell In[3], line 6
    backend = FakeManilaV2()
  File /opt/conda/lib/python3.10/site-packages/qiskit/providers/fake_provider/fake_backend.py:76 in __init__
    self._conf_dict = self._get_conf_dict_from_json()
  File /opt/conda/lib/python3.10/site-packages/qiskit/providers/fake_provider/fake_backend.py:137 in _get_conf_dict_from_json
    conf_dict = self._load_json(self.conf_filename)
  File /opt/conda/lib/python3.10/site-packages/qiskit/providers/fake_provider/fake_backend.py:155 in _load_json
    with open(os.path.join(self.dirname, filename)) as f_json:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.10/site-packages/qiskit_ibm_runtime/fake_provider/backends/manila/conf_manila.json'
  • qiskit-ibm-runtime version: 0.17.0
  • Python version: 3.10.8
  • Operating system: Linux
@mrvee-qC-bee mrvee-qC-bee added the bug Something isn't working label Jan 17, 2024
@kt474
Copy link
Member

kt474 commented Jan 17, 2024

What version of Qiskit are you using? The code snippet works for me.

Screenshot 2024-01-16 at 10 40 32 PM

@mrvee-qC-bee
Copy link
Contributor Author

mrvee-qC-bee commented Jan 17, 2024

Hi @kt474! This was on qiskit version 0.45.1

@ElePT
Copy link
Collaborator

ElePT commented Jan 17, 2024

Hi @mrvee-qC-bee, I think that this might an installation issue (something related to the interaction between qiskit and qiskit-ibm-runtime). In principle, the error should not happen. It might help to try installing qiskit-ibm-runtime from source, as #1270 moved the fake backend base classes to qiskit-ibm-runtime, so maybe that would help reduce Python's confusion finding the files.

@mtreinish
Copy link
Member

The root cause of this issue is that the json response snapshots aren't being included in the package files. The manifest list: https://github.com/Qiskit/qiskit-ibm-runtime/blob/main/MANIFEST.in will need to be updated to include the json files. Without including the json files in the manifest then when you install via a hosted package the JSON files which are in the source repo aren't present and you'll encounter an error like this.

@ElePT
Copy link
Collaborator

ElePT commented Jan 17, 2024

Sorry for that, here is the fix: #1319.

@kt474 kt474 added this to the 0.18.0 milestone Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants