Matplotlib 1.1.0 and PySide

Dear all, matplotlib users and devs,

I have been trying the latest announced version of Matplotlib (1.1.0). The new feature that attracted me is the PySide support.

However, I tried to install it under Ubuntu 11.04, but I needed pyqt4 installed in order to install it from source. Is there a way to install it with only pyside installed?

Once installed, I could uninstall pyqt4, and run my python scripts, with replacing pyqt4 by pyside. However, I am not sure what the "ETS environment variable" is (yes, it s related to the enthought tool suite, but what if I do not want it - for now), and I had to set the QT_API variable on the command line call to python: setting it as a "normal" environment variable does not work. So, to be able to use "only" pyside, I need to do:

QT_API=pyside python myscript.py

Is that the right way to do so? Is there any way of setting the QT_API more "definitely", and not having to change the call to python?

So far, my program (I really have only one at the moment) seems to work well, using QtCore, QtGui and phonon, except for phonon, where it seems that "seeking" in a file does not really work under Ubuntu... if anyone has an idea (I know, not the right mailing list, but just in case).

At last, probably a question that will solve all the above ones: when is the new Matplotlib version going to be included in EPD? That's, by the way, mainly the reason why I consider using PySide instead of PyQt4.

Thanks for reading!

Cheers,

Jean-Louis

Hi Jean-Louis,

Is that the right way to do so? Is there any way of setting the QT_API more "definitely", and not having to change the call to python?

Yes, in your $HOME/.bashrc file that your shell loads at startup time,
you can write

export QT_API="pyside"

And this will ensure that you always have this variable set as part of
your 'environment'. The concept of 'environment' is a unix-specific
idea of a set of variables and other parameters visible to any
program; you can actually read and write the enviroment in python by
importing 'os' and using the os.environ variable:

export SOMEVAR="Hello matplotlib" ipython --no-banner

In [1]: import os

In [2]: os.environ['SOMEVAR']
Out[2]: 'Hello matplotlib'

Cheers,

f

···

On Thu, Oct 13, 2011 at 1:47 AM, Durrieu Jean-Louis <jean-louis.durrieu@...2003...> wrote:

Dear all, matplotlib users and devs,

I have been trying the latest announced version of Matplotlib
(1.1.0). The new feature that attracted me is the PySide support.

However, I tried to install it under Ubuntu 11.04, but I needed pyqt4
installed in order to install it from source. Is there a way to
install it with only pyside installed?

There is no compiled qt4 code, so installation should not require pyqt4--and I don't think it does. What led to your conclusion that you needed it to install from source?

In any case, I opened
Check for pyside in setupext.py by mdboom · Pull Request #521 · matplotlib/matplotlib · GitHub for this.

Once installed, I could uninstall pyqt4, and run my python scripts,
with replacing pyqt4 by pyside. However, I am not sure what the "ETS
environment variable" is (yes, it s related to the enthought tool
suite, but what if I do not want it - for now), and I had to set the
QT_API variable on the command line call to python: setting it as a
"normal" environment variable does not work. So, to be able to use
"only" pyside, I need to do:

QT_API=pyside python myscript.py

Is that the right way to do so? Is there any way of setting the
QT_API more "definitely", and not having to change the call to
python?

This does not make sense to me. Assuming you are using bash, put this in your .bashrc file:

export QT_API=pyside

Anything you execute in a terminal window opened after that change should find the new environment variable.

Eric

···

On 10/12/2011 10:47 PM, Durrieu Jean-Louis wrote:

So far, my program (I really have only one at the moment) seems to
work well, using QtCore, QtGui and phonon, except for phonon, where
it seems that "seeking" in a file does not really work under
Ubuntu... if anyone has an idea (I know, not the right mailing list,
but just in case).

At last, probably a question that will solve all the above ones: when
is the new Matplotlib version going to be included in EPD? That's, by
the way, mainly the reason why I consider using PySide instead of
PyQt4.

Thanks for reading!

Cheers,

Jean-Louis

Hi Eric, Fernando,

thanks for your answers!

There is no compiled qt4 code, so installation should not require
pyqt4--and I don't think it does. What led to your conclusion that you
needed it to install from source?

It s just that when I type "python setup.py build/--help/install", depending on whether pyqt4 is installed or not, the script detects that Qt is present or not (respectively), and pyside does not change that behaviour. I must admit I did not try to run my script even when Qt was not detected, maybe it works... But I guess there is a consequence to the detection of Qt at the build step?

Sorry for not providing the exact output of the build step, I m on another computer. On my mac, the section of interest is:
OPTIONAL BACKEND DEPENDENCIES
                libpng: 1.5.2
               Tkinter: Tkinter: version not identified, Tk: 8.5, Tcl: 8.5
                  Gtk+: no
                        * Building for Gtk+ requires pygtk; you must be able
                        * to "import gtk" in your build/install environment
       Mac OS X native: yes
                    Qt: no
                   Qt4: Qt: 4.7.3, PyQt4: 4.8.5
                 Cairo: no

Here, it detected my pyqt4. But when it s not there, even if pyside is installed, I get a "Qt4: no" instead... Do you mean that it's still going to work, even it was not detected there?

This does not make sense to me. Assuming you are using bash, put this
in your .bashrc file:

export QT_API=pyside

Anything you execute in a terminal window opened after that change
should find the new environment variable.

Oh, sorry for that! I must have been confused, I think I only typed "QT_API=pyside" at the prompt, so I guess without the "export" (doh!), that was useless... Since the doc (somewhere) talked about "ETS environment variables", I thought there was something else to it. If not, then I ll have to learn my bash again :slight_smile:

Not a big issue, anyway!

Cheers!

Jean-Louis

···

On Oct 13, 2011, at 8:47 PM, Eric Firing wrote:

On 10/12/2011 10:47 PM, Durrieu Jean-Louis wrote:

Hi Eric, Fernando,

thanks for your answers!

There is no compiled qt4 code, so installation should not require
pyqt4--and I don't think it does. What led to your conclusion that
you needed it to install from source?

It s just that when I type "python setup.py build/--help/install",
depending on whether pyqt4 is installed or not, the script detects
that Qt is present or not (respectively), and pyside does not change
that behaviour. I must admit I did not try to run my script even when
Qt was not detected, maybe it works... But I guess there is a
consequence to the detection of Qt at the build step?

Sorry for not providing the exact output of the build step, I m on
another computer. On my mac, the section of interest is: OPTIONAL
BACKEND DEPENDENCIES libpng: 1.5.2 Tkinter: Tkinter: version not
identified, Tk: 8.5, Tcl: 8.5 Gtk+: no * Building for Gtk+ requires
pygtk; you must be able * to "import gtk" in your build/install
environment Mac OS X native: yes Qt: no Qt4: Qt: 4.7.3, PyQt4: 4.8.5
Cairo: no

Here, it detected my pyqt4. But when it s not there, even if pyside
is installed, I get a "Qt4: no" instead... Do you mean that it's
still going to work, even it was not detected there?

Yes, it should work fine; as far as I know, nothing depends on the outcome of that auto-detection for qt4. The pyside support is always included in backend_qt4.py and backend_qt4agg.py, which are pure python, and are present regardless of whether pyqt4 itself is detected.

Eric

This does not make sense to me. Assuming you are using bash, put
this in your .bashrc file:

export QT_API=pyside

Anything you execute in a terminal window opened after that change
should find the new environment variable.

Oh, sorry for that! I must have been confused, I think I only typed
"QT_API=pyside" at the prompt, so I guess without the "export"
(doh!), that was useless... Since the doc (somewhere) talked about
"ETS environment variables", I thought there was something else to
it. If not, then I ll have to learn my bash again :slight_smile:

Not a big issue, anyway!

Cheers!

Jean-Louis
------------------------------------------------------------------------------

All the data continuously generated in your IT infrastructure contains a

···

On 10/13/2011 09:50 AM, Durrieu Jean-Louis wrote:

On Oct 13, 2011, at 8:47 PM, Eric Firing wrote:

On 10/12/2011 10:47 PM, Durrieu Jean-Louis wrote:

definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and
makes sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________ Matplotlib-users
mailing list Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options