0
$\begingroup$

I am running my old qiskit code after a very long time it's not running now showing error wrong color format 'ansibrightred' and I don't know why?

from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister

circuit = QuantumCircuit(2,2)
circuit.h(0)
circuit.cx(0,1)
circuit.measure([0,1], [0,1])
$\endgroup$
  • $\begingroup$ Hi! What Qiskit versions are you using? $\endgroup$ – met927 Apr 23 at 8:04
3
$\begingroup$

That error is caused by running qiskit-terra 0.13.0 with pygments installed, but below the optional dependency minimum version of 2.4: https://github.com/Qiskit/qiskit-terra/blob/master/setup.py#L117. However, you've found a bug in terra, an error should only be shown if you are using the optional functionality (circuit.qasm() with formatted=True set or using the circuit library jupyter widget). I've pushed up a fix to address this edge case in: https://github.com/Qiskit/qiskit-terra/pull/4229

In the meantime while waiting for that to get into a release, you can workaround this issue by either installing pygments>=2.4 or uninstalling pygments. Either will fix the error.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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