[IPython-User] ValueError: API 'QString' has already been set to version 1

Jonathan Stickel jjstickel@gmail....
Mon Feb 13 15:33:13 CST 2012


I recently got bit by the error in the subject line.  It arose when I 
installed Mayavi-4.1.0 (with pyface-4.1.0 as a dependency) and imported 
mlab.  However, it can be reproduced most simply by doing:


$ ipython --gui=qt
<...>
In [1]: import sip

In [2]: sip.setapi('QString', 2)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/Users/jstickel/<ipython-input-2-d786b937fa44> in <module>()
----> 1 sip.setapi('QString', 2)

ValueError: API 'QString' has already been set to version 1


It also occurs inside a qtconsole started with "ipython qtconsole 
--pylab".  Fortunately, I found that the workaround suggested here:

http://readthedocs.org/docs/neuronvisio/en/latest/gettingstarted.html

namely,

$ export QT_API==pyqt

worked for me.  I am using python-2.6.  I understand that this will not 
happen with python-3.x.  Anyway, I am reporting to this list in case it 
might help others.  This might be worth having in the IPython FAQ as well.

Regards,
Jonathan


More information about the IPython-User mailing list