Closed unico20 closed 1 year ago
Hi, this seems like a Qiskit related problem. Did you try reinstalling Qiskit or installing a different version? My local version and the GitHub repo don't have the folder "styles"
Thanks a lot for your help. Yes, I have reinstalled Qiskit and tried with other versions. I also tried with another Python version (3.10.12) and with virtual environments with
qiskit[visualization]
installed qiskit
installed pylatexenc
in order to use MatplotlibDrawer
In all cases, I obtained a similar error:
/path/to/qiskit/visualization/matplotlib.py:162: UserWarning: Style JSON file 'text.json' not found in any of these locations: /path/to/qiskit/visualization/styles/text.json, text.json. Will use default style.
self._style, def_font_ratio = load_style(style)
QuantumCircuit:
---------------
Figure(220.569x117.056)
Live QuantumVariables:
----------------------
QuantumVariable qv_0
What changed, however, is the search path, namely the circuit
folder between visualization
and styles
. This new path also exists in the GitHub repo, but doesn't contain the searched file text.json
either :(
Can you post the full error message including traceback?
Yes, I edited the message. Does that help?
Your folder structure is different from my local folder structure and also from the github page. The "visualization" folder doesn't contain a matplotlib file. The circuit sub folder contains one, but this file also doesn't contains no such user warning. To me, it seems like you installed the newest version of Qiskit to some environment, but try to start Qrisp/Qiskit (unintentionally) in a different environment. This would explain why your folder structure looks different in the error message. Maybe clear your PATH variable?
The warning you posted is in this file now
The whole path is
home/unico/anaconda3/envs/Qrisp_env/lib/python3.10/site-packages/qiskit/visualization/matplotlib.py
or similar: I used different environments (here: Qrisp_env
) to try different versions of python/qiskit.
That file, matplotlib.py should not be in that folder. Can you try reinstalling from different sources (make a new environment for this):
If you used Conda for installation, try pip or try Conda if you previously used pip. If it still doesn't work, you can be super sure and install from source. For this follow these steps
pip install -e ./
More info on installing from source here
Hi all :) I have problems with printing circuits:
yields
Does anyone know the file 'text.json' or have a clue how to get it?
I have python version
3.8.10
installed and the following__qiskit_version__
:{'qiskit-terra': '0.24.1', 'qiskit-aer': '0.12.0', 'qiskit-ignis': None, 'qiskit-ibmq-provider': '0.20.2', 'qiskit': '0.43.1', 'qiskit-nature': None, 'qiskit-finance': None, 'qiskit-optimization': None, 'qiskit-machine-learning': None}
Thanks a lot for any inspiration :-)