I really want to switch to Python 3, but Ubuntu 14.04 makes it difficult to do so when using the IPython+pylab framework.
My settings: I have installed most of the important packages using
pip rather than
aptitude. Thes packages include numpy 1.10.1, scipy 0.16.1, matplotlib 1.5.0, pylab 0.1.0 and IPython 4.0.1.
I have also installed python3-pyqt5 5.2.1 and python3-pyside 1.2.1 using
matplotlib from within
IPython works well:
import matplotlib.pyplot as plt plt.plot([0, 1], [1, 2]) plt.show()
But the problem starts when I try to use
pylab, either by calling
ipython --pylab or by calling
pylab from within IPython. This is what I get in both of these cases:
ImportError: Could not load requested Qt binding. Please ensure that PyQt4 >= 4.7, PyQt5 or PySide >= 1.0.3 is available, and only one is imported per session. Currently-imported Qt library: 'pyqt5' PyQt4 installed: False PyQt5 installed: False PySide >= 1.0.3 installed: True Tried to load: ['pyqt5']
So, if I understand it properly, it does not recognize that
PyQt5 is installed. This is weird for two reasons; first,
import PyQt5 and
import PyQt5.QtCore both don't complain. The second reason is that a second call to pylab works perfectly, and with Qt5!
Using matplotlib backend: Qt5Agg Populating the interactive namespace from numpy and matplotlib
However, there's another consequence for this. After plotting, successfully (say, with
plot([0, 1], [1, 2])), when I exit IPython using Ctrl-D, I get a
Segmentation fault (core dumped).
This is a problem I have for about 3 months now. I have already posted a couple of questions here: Really installing PyQt4/5 for python 3.4 on trusty and https://stackoverflow.com/questions/32007733/pip-install-pyside-fails. I have tried probably almost all combinations of installing pyside/pyqt5/numpy/scipy/matplotlib/ipython/pylab via pip/aptitude. Nothing seems to work properly.