Hi Everyone! Has anyone used matplotlib 2.0.0 with...
# questions
Hi Everyone! Has anyone used matplotlib 2.0.0 with Kedro 0.17.7 before? I am getting error. I have installed PyQt5 and pyside2 but still getting the same error. I'd grateful for any help. Thanks a lot!
Copy code
File "/usr/local/lib/python3.6/site-packages/matplotlib/backends/qt_compat.py", line 175, in <module>
    "Matplotlib qt-based backends require an external PyQt4, PyQt5,\n"
ImportError: Matplotlib qt-based backends require an external PyQt4, PyQt5,
or PySide package to be installed, but it was not found.
hi @Suyash Shrivastava! I don't think it's a Kedro problem but I'm happy to help 😄
when you say you have PyQt5 and PySide2 installed, how do you know?
the reason I ask is that matplotlib seems to be installed globally in
, which might be managed by your Linux package manager
Hi Juanlu, PyQt5 is installed at /home/cdsw/.local/lib/python3.6/site-packages
then it's probably a problem of Python not finding it in the right path
any idea how to solve that 🙂 btw thanks a lot for the help!
my recommendation would be to use a virtual environment and install both matplotlib and PyQt5 on it:
Copy code
$ cd /home/cdsw/Projects/kedro-test
$ /usr/local/bin/python3.6 -m venv .venv
$ source .venv/bin/activate
(.venv) $ pip install matplotlib pyqt5 pyside2  # didn't test
(.venv) $ python -c "import matplotlib.backends.qt_compat"  # check if it works
yes thats a problem. I am working on client infra where I can't create virtual environments matplotlib is installed at /usr/local/lib/python3.6/site-packages
if you can't create virtual environments then you'll need to
/usr/local/bin/python3.6 -m pip install pyqt5
. there's a chance that you already did, and it ended up in
. that means that you don't have permissions to do
sudo ... pip install
. which is a good thing anyway 😄 so another thing you can try is launching your script with
so that the global matplotlib "sees" the local PyQt5
👍🏼 1
Thanks Juanlu!, will try that and let you know!
🙌🏼 1
+1 on
or sys.path if virtualenv is not an option
🙌 1
cc @Amith Nair