Reputation: 21
The following code gives error: Matplotlib gives This application failed to start because it could not find or load the Qt platform plugin "xcb" in "".
import matplotlib.pyplot as plt
import numpy as np
# Create the vectors X and Y
x = np.array(range(100))
y = x ** 2
# Create the plot
plt.plot(x,y)
# Show the plot
plt.show()
Upvotes: 1
Views: 1504
Reputation: 21
The solution was to install PyQt5 /EnvironmentDirectoryPath/pip3 install PyQt5
.
Found details at https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#understanding-the-correct-version-to-install
I also installed it system wide with sudo apt-get install python-qt4
with no ill effects.
Upvotes: 1