Suyash Shrivastava
07/26/2023, 3:23 PMFile "/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.
Juan Luis
07/26/2023, 3:30 PM/usr/local/lib/python3.6
, which might be managed by your Linux package managerSuyash Shrivastava
07/26/2023, 3:34 PMJuan Luis
07/26/2023, 3:35 PMSuyash Shrivastava
07/26/2023, 3:35 PMJuan Luis
07/26/2023, 3:37 PM$ 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
Suyash Shrivastava
07/26/2023, 3:41 PMJuan Luis
07/26/2023, 3:43 PM/usr/local/bin/python3.6 -m pip install pyqt5
. there's a chance that you already did, and it ended up in ~/.local
. 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 PYTHONPATH=/home/cdsw/.local/lib/python3.6/site-packages
so that the global matplotlib "sees" the local PyQt5Suyash Shrivastava
07/26/2023, 3:48 PMNok Lam Chan
07/26/2023, 8:46 PMPYTHONPATH
or sys.path if virtualenv is not an optionSuyash Shrivastava
08/11/2023, 5:37 PM