Quantum Computing Asked by vardhan_negi on March 27, 2021
When I run the following command
qc.draw(output='mpl')
for my circuit qc, I get this error:
ImportError: The class MatplotlibDrawer needs pylatexenc
How do I address this issue? Below an image of my problem
Update ——
Installation steps on Google Colaboratoy:
!pip install pylatexenc ?
.
The installation attempt (was successful and the installed pylatexenc
has version 2.7
.)
The 0.15.2
is actually the version of your qiskit-terra
package not Qiskit itself.
I'd suggest you to check the version by qiskit.__qiskit_version__
. See the documentation.
If all packages have the latest version, you simply need to install pylatexenc
in the same env
where your Qiskit has been installed. Just by typing pip install pylatexenc
in terminal!
In case you don't have the latest version of Qiskit.
You need to upgrade it first by pip install qiskit --upgrade
and then install pylatexenc
.
Update
For Google Colab, this thread from Stackoverflow might be relevant.
%pip install pylatexenc
Answered by user9318 on March 27, 2021
use %matplotlin inline
before executing draw('mpl')
here is the link for more info
Answered by vardhan_negi on March 27, 2021
It's an issue with latest Qiskit I've noticed. Use following command to downgrade it to previous version(0.16.1 specifically) for the time being.
!pip install qiskit==0.16.1
Answered by dushyanth on March 27, 2021
In my case, running same command ( with !pip install pylatexenc
) inside the jupyter notebook solved the issue!
Answered by Sona_QC on March 27, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP