I am trying to use the MatPlotLib library on Windows 7, and to that end I am using Enthought Canopy to make the installation process simpler. However, upon importing Pylab with import pylab
, I get "ImportError: No module named 'PySide'". As I understand, PySide is provided with Canopy, thus I don't understand why can't it find it? On the package list of Canopy there is no PySide, and I can't import it. How do I tell the interpreter to use PySide provided with Canopy, and if I can't, how else do I use MatPlotLib?
Asked
Active
Viewed 333 times
0

Spideyyyy
- 123
- 4
-
As far as I understand, using the `pylab` import is no longer recommended. So just use `matplotlib`, check out [this question](https://stackoverflow.com/questions/16849483/which-is-the-recommended-way-to-plot-matplotlib-or-pylab). If you are using a tutorial or something that is telling you to use `pylab`, it is probably woefully out of date. – juanpa.arrivillaga Oct 04 '17 at 18:22
-
When asking about an error you would need to provide the full error traceback. To avoid the error you can try using a different backend, `import matplotlib; matplotlib.use("TkAgg")` since Tk should be included in python itself. – ImportanceOfBeingErnest Oct 04 '17 at 18:36
-
I also tried using `import matplotlib.pyplot as plt` just like in that question, but the error remains the same: ImportError: Matplotlib qt-based backends require an external PyQt4, PyQt5, or PySide package to be installed, but it was not found. – Spideyyyy Oct 04 '17 at 18:37
-
@Spideyyyy that isn't the error you originally reported at all. – juanpa.arrivillaga Oct 04 '17 at 18:44
-
Adding `import matplotlib; matplotlib.use("TkAgg")` at the beginning seems to have fixed it. @ImportanceOfBeingErnest, if you write it in an answer I can accept it. – Spideyyyy Oct 04 '17 at 18:44
-
This is not the answer, it's the test to see where the error comes from. The answer is to install PyQt4 or PyQt5. – ImportanceOfBeingErnest Oct 04 '17 at 18:48