# QuantumInstance object has no attribute “name” [closed]

I follow qiskit tutorial "Portfolio optimization". When I executed this cell, I encounter the attribute error as the title(picture showed below).

Do anyone know how to fix this problem? It seems like the problem is inside the package, so I have no idea...

• I’m voting to close this question because I think that technical Qiskit questions such as this should be issues on Qiskit's GitHub. – Cryoris Jun 28 at 14:47

As the error message stated, QuantumInstance has no attribute name.

What it has is backend and from backend you can retrieve name.

For example:

quantum_instance = QuantumInstance(backend=Aer.get_backend('statevector_simulator'))
quantum_instance.backend


will printout:

StatevectorSimulator('statevector_simulator')


and if you do

quantum_instance.backend.name()


it will printout

'statevector_simulator'