On my OS(Linux Mint Debian Edition 2), except for the system python(/usr/bin/python) installed by the apt, I also installed the anaconda. But I've encounterd a problem running the following code with the anaconda python
# test.py import matplotlib.pyplot as plt import numpy as np x = np.array([0, 1]) plt.scatter(x, x) plt.show()
The error is
This application failed to start because it could not find or load the Qt platform plugin "xcb".
Reinstalling the application may fix this problem.
Aborted
But if I try with the system python, i.e., /usr/bin/python test.py
, it works correctly.
Then I tried the ipythons, of system and of anaconda, the result is same as before: the anaconda ipython kernel died.
And I tried add the ipython magic %matplotlib inline
into the code, the anaconda ipython works correctly now. But if I replace the %matplotlib inline
with %pylab
, the anaconda ipython died again.
Note: I use the python 2.7. System ipython's version is 2.3, anaconda ipython's version is 3.2.
On Linux, the xcb QPA (Qt Platform Abstraction) platform plugin is used. It provides the basic functionality needed by Qt GUI and Qt Widgets to run against X11. Its library dependencies are described the following table.
Note: You can install only plugins that are supported by your Qt Creator version. To install plugins: Select Help > About Plugins > Install Plugins. In the Source dialog, enter the path to the archive or library that contains the plugin.
In Qt, when an application starts, the application's executable directory is the base directory where Qt searches for plugins. For example, on Windows, if the application is in C:\Program Files\MyApp and it has a style plugin, Qt looks in C:\Program Files\MyApp\styles .
Same problem with Linux Mint 17, 64 bit. It was solved after 4h searching on the net! You need to give these commands on the terminal from folder /anaconda2/bin
sudo ./conda remove qt sudo ./conda remove pyqt sudo ./conda install qt sudo ./conda install pyqt
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With