0
$\begingroup$
execute(circuit, backend = simulator).result()
plot_histogram(result.get_counts(circuit))

Error: module 'qiskit.result' has no attribute 'get_counts'
$\endgroup$
1
  • $\begingroup$ Hi, do you have a minimal example of code that displays this error, for people to try running to help find where the problem is? $\endgroup$
    – Mithrandir24601
    Feb 12 at 10:58
1
$\begingroup$

You did not assign the variable result. Try the following:

result = execute(circuit, backend = simulator).result() 
plot_histogram(result.get_counts(circuit))
$\endgroup$
1
  • $\begingroup$ Thanks a lot, man. I am a beginner right now that's why I was struggling! $\endgroup$
    – sohamb172
    Feb 5 at 9:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.