Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpl 1.5.1 requires pyqt even with a wx backend #6559

Closed
briantoby opened this issue Jun 8, 2016 · 5 comments
Closed

mpl 1.5.1 requires pyqt even with a wx backend #6559

briantoby opened this issue Jun 8, 2016 · 5 comments

Comments

@briantoby
Copy link

After building a customized miniconda with anaconda/Constructor that contains wxpython but not Qt or Tk, I find that mpl is still requiring that pyqt be installed to simply import. It seems to me to be a bug to require a package that is not really needed.

A subset of packages I am including are listed below:

06/07/2016 04:17 PM 236,150 conda-4.0.8-py27_0.tar.bz2
06/07/2016 04:20 PM 6,409,202 matplotlib-1.5.1-np110py27_0.tar.bz2
06/07/2016 04:17 PM 3,080,830 numpy-1.10.4-py27_0.tar.bz2
06/07/2016 04:18 PM 1,098,309 pyopengl-3.1.1a1-np110py27_0.tar.bz2
06/07/2016 04:15 PM 24,267,498 python-2.7.11-4.tar.bz2
06/07/2016 04:17 PM 629,606 requests-2.10.0-py27_0.tar.bz2
06/07/2016 04:20 PM 11,573,249 scipy-0.16.1-np110py27_1.tar.bz2
06/07/2016 04:17 PM 20,338,598 wxpython-3.0-py27_0.tar.bz2

The error message (somewhat trimmed) is below, but it is clear that simply importing pylab is causing the problem

d:\GSASII>C:\Users\vondreele\g2conda\python.exe GSASII.py
GSAS-II binary directory: d:\GSASII\bin
5 values read from config file d:\GSASII\config.pyc
Traceback (most recent call last):
File "d:\GSASII\GSASIImath.py", line 38, in
import pylab as pl
File "C:\Users\vondreele\g2conda\lib\site-packages\pylab.py", line 1, in
from matplotlib.pylab import *
File "C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\pylab.py", line 274, in
from matplotlib.pyplot import *
File "C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\pyplot.py", line 114, in
backend_mod, new_figure_manager, draw_if_interactive, show = pylab_setup()
File "C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends__init
.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends\backend_qt4agg.py", line 18, in
from .backend_qt5agg import FigureCanvasQTAggBase as _FigureCanvasQTAggBase
File "C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 15, in
from .backend_qt5 import QtCore
File "C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends\backend_qt5.py", line 31, in
from .qt_compat import QtCore, QtGui, QtWidgets, _getSaveFileName, version
File "C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends\qt_compat.py", line 162, in
"Matplotlib qt-based backends require an external PyQt4, PyQt5,\n"
ImportError: Matplotlib qt-based backends require an external PyQt4, PyQt5,
or PySide package to be installed, but it was not found.

@WeatherGod
Copy link
Member

chances are, the default backend is a qt-based one. Double-check your
defaults

On Wed, Jun 8, 2016 at 1:07 PM, Brian Toby notifications@github.com wrote:

After building a customized miniconda with anaconda/Constructor that
contains wxpython but not Qt or Tk, I find that mpl is still requiring that
pyqt be installed to simply import. It seems to me to be a bug to require a
package that is not really needed.

A subset of packages I am including are listed below:

06/07/2016 04:17 PM 236,150 conda-4.0.8-py27_0.tar.bz2
06/07/2016 04:20 PM 6,409,202 matplotlib-1.5.1-np110py27_0.tar.bz2
06/07/2016 04:17 PM 3,080,830 numpy-1.10.4-py27_0.tar.bz2
06/07/2016 04:18 PM 1,098,309 pyopengl-3.1.1a1-np110py27_0.tar.bz2
06/07/2016 04:15 PM 24,267,498 python-2.7.11-4.tar.bz2
06/07/2016 04:17 PM 629,606 requests-2.10.0-py27_0.tar.bz2
06/07/2016 04:20 PM 11,573,249 scipy-0.16.1-np110py27_1.tar.bz2
06/07/2016 04:17 PM 20,338,598 wxpython-3.0-py27_0.tar.bz2

The error message (somewhat trimmed) is below, but it is clear that simply
importing pylab is causing the problem

d:\GSASII>C:\Users\vondreele\g2conda\python.exe GSASII.py
GSAS-II binary directory: d:\GSASII\bin
5 values read from config file d:\GSASII\config.pyc
Traceback (most recent call last):
File "d:\GSASII\GSASIImath.py", line 38, in
import pylab as pl
File "C:\Users\vondreele\g2conda\lib\site-packages\pylab.py", line 1, in
from matplotlib.pylab import *
File "C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\pylab.py",
line 274, in
from matplotlib.pyplot import *
File "C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\pyplot.py",
line 114, in

backend_mod, new_figure_manager, draw_if_interactive, show =
pylab_setup() File
"C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends__init
.py",
line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File
"C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends\backend_qt4agg.py",
line 18, in
from .backend_qt5agg import FigureCanvasQTAggBase as

_FigureCanvasQTAggBase File
"C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends\backend_qt5agg.py",
line 15, in from .backend_qt5 import QtCore File
"C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends\backend_qt5.py",
line 31, in from .qt_compat import QtCore, QtGui, QtWidgets,
getSaveFileName, _version
File
"C:\Users\vondreele\g2conda\lib\site-packages\matplotlib\backends\qt_compat.py",
line 162, in
"Matplotlib qt-based backends require an external PyQt4, PyQt5,\n"
ImportError: Matplotlib qt-based backends require an external PyQt4, PyQt5,
or PySide package to be installed, but it was not found.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#6559, or mute the thread
https://github.com/notifications/unsubscribe/AARy-A011yrype0zxwGzrrY1LD9Onxu9ks5qJva9gaJpZM4IxL9b
.

@briantoby
Copy link
Author

How is that done? I know we use wxagg in places.

@tacaswell
Copy link
Member

Before import pylab as pl put a

import matplotlib
matplotlib.use('wxagg')

The default rcparams file that is installed with the anaconda package patched to set 'qt4agg' as the default backend.

@tacaswell
Copy link
Member

also, for embedding in gsasII you probably should not be importing pylab/pyplot at all and managing your Figure/Canvas objects your self.

@briantoby
Copy link
Author

My mistake! There was a stray debug line left in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants