entropicalabs / openqaoa

Multi-backend SDK for quantum optimisation
MIT License
113 stars 58 forks source link

pip install openqaoa throws some qiskit error #296

Closed kidiki closed 3 months ago

kidiki commented 7 months ago

When running in Colab, installing openqaoa with 'pip install openqaoa' and then simply running 'from openqaoa.problems import NumberPartition' throws and error 'ImportError: Missing optional 'qiskit' dependencies. To install run: pip install azure-quantum[qiskit]'

However, after installing the error persists.

Screenshots

Screenshot 2023-12-04 at 23 17 46

Additional context

Current fix is installing openqaoa-core only.

KilianPoirier commented 7 months ago

This is addressed in PR#297

bsiegelwax commented 6 months ago

What's the status of this? I was just about to report this same issue.

KilianPoirier commented 6 months ago

Thanks for reporting that the issue still persists for you. This is due to a version limitation on azure-quantum[qiskit] (more specifically). When installing the openqaoa meta-package, the qiskit installation is apparently resolved by installing openqaoa-qiskit first and then openqaoa-azure, resulting in incompatibilities. This does not happen when installing locally. This issue should be fixed on Azure Quantum's side.

In the meantime, here are some solutions you may want to try: