Skip to content

ImportError/FileNotFoundError for VERSION.txt after pip install qiskit-ibm-runtime #2248

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

Open
KaranSinghDev opened this issue May 3, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@KaranSinghDev
Copy link

Describe the bug
After successfully installing qiskit-ibm-runtime (version 0.38.0) via pip, attempting import qiskit_ibm_runtime fails with a FileNotFoundError. The error indicates the package is looking for qiskit_ibm_runtime/VERSION.txt relative to the current working directory, instead of its installation location in site-packages. This prevents using the package after a standard installation unless the current working directory happens to be the root of the source code clone.

Steps to reproduce
Start with a clean Python environment (e.g., new venv or container).
Install the necessary packages:
pip install qiskit>=1.0 qiskit-ibm-runtime==0.38.0

Ensure the current working directory is outside any cloned source directory for qiskit-ibm-runtime.
Run Python and execute:
import qiskit_ibm_runtime
Observe the FileNotFoundError traceback pointing to a path relative to the CWD for VERSION.txt. Example path observed: /kaggle/working/qiskit-ibm-runtime/qiskit_ibm_runtime/VERSION.txt (when CWD was /kaggle/working/qiskit-ibm-runtime).

Expected behavior
The import qiskit_ibm_runtime statement should execute successfully without errors after a standard pip installation, regardless of the current working directory.

Suggested solutions
The code responsible for reading VERSION.txt during package initialization likely needs to be updated to use a path relative to the installed package's location (e.g., using importlib.resources or file) rather than relying on the current working directory.

Additional Information
If the current working directory is set to the root of a cloned source code directory for qiskit-ibm-runtime before attempting the import, the import succeeds because the relative path lookup finds the VERSION.txt file within that source tree. This confirms the issue is related to path resolution after installation.
qiskit-ibm-runtime version: 0.38.0
qiskit version: 2.0.0
Python version: 3.11.11 (Observed on Kaggle, likely affects other 3.x versions)
Operating system: Linux (Ubuntu derivative on Kaggle)

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

No branches or pull requests

1 participant