Skip to content

ImportError: cannot import name 'Estimator' from 'qiskit.primitives' #327

@eburnette

Description

@eburnette

Describe the bug
Import fails with an error.

pip.txt

To Reproduce
Check out the repo
Copy the example below (testit.py)
Run: pip install -e .
Run: python testit.py

from squlearn import Executor
from squlearn.encoding_circuit import (HighDimEncodingCircuit)
from squlearn.kernel import ProjectedQuantumKernel, QSVC

high_dim_ec = HighDimEncodingCircuit(
    num_qubits=4, num_features=3, num_layers=2)
pqk = ProjectedQuantumKernel(
    encoding_circuit=high_dim_ec,
    executor=Executor())
qsvc = QSVC(quantum_kernel=pqk)
print(qsvc)

Expected behavior
I expect the code to work without an error.

Additional context
I included pip.txt to show versions.
I did try it with earlier versions of qiskit but couldn't find one that didn't give some kind of import error.
For example with quiskit 1.4.2, I get:
ImportError: cannot import name 'Options' from 'qiskit_ibm_runtime.options'
on that first line.

pip.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions