Frank Carmody
Frank Carmody

Reputation: 21

Matplotlib gives This application failed to start because it could not find or load the Qt platform plugin "xcb" in ""

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

Answers (1)

Frank Carmody
Frank Carmody

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

Related Questions