PyQt4 vs sip versions

0 views
Skip to first unread message

Ray Osborn

unread,
May 18, 2016, 1:06:28 PM5/18/16
to conda - Public
A colleague just installed an Anaconda Python 2.7 distribution on Mac OS X 10.9 and tried to run a conda-installed module (https://anaconda.org/nexpy/nexpy) that uses the Matplotlib qt_compat module to import PyQt4. However, she got the following error message:

$ nexpy
Traceback (most recent call last):
  File "/Applications/anaconda/bin/nexpy", line 6, in <module>
    sys.exit(nexpy.nexpygui.main())
  File "build/bdist.macosx-10.5-x86_64/egg/nexpy/nexpygui.py", line 25, in main
  File "build/bdist.macosx-10.5-x86_64/egg/nexpy/gui/consoleapp.py", line 30, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/nexpy/gui/pyqt.py", line 9, in <module>
  File "/Applications/anaconda/lib/python2.7/site-packages/matplotlib/backends/qt_compat.py", line 124, in <module>
    from PyQt4 import QtCore, QtGui
RuntimeError: the sip module implements API v8.0 to v8.1 but the PyQt4.QtCore module requires API v11.2

I seemed to recall a problem like this before that was solved by removing the conda sip package and installing sip with pip, but that seems to have made matters worse. Now, she gets a "Could not find a version that satisfies the requirement sip" error message. Is this a problem with running an older Mac OS X version or does anyone have other suggestions? 

I can't reproduce the error but I would like to be able to give advice to people installing nexpy if they encounter the same problem.

Thanks,
Ray

Carlos Córdoba

unread,
May 18, 2016, 4:21:28 PM5/18/16
to co...@continuum.io
Hi,

We support OS X 10.7 and above, so there shouldn't be problems with 10.9 :-)

Is your colleague able to run Matplotlib before installing nexpy?


Cheers,
Carlos

El 18/05/16 a las 12:06, Ray Osborn escribió:
--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.

Ray Osborn

unread,
May 18, 2016, 6:00:13 PM5/18/16
to conda - Public
Good question. I'll check with her in the morning and get back to you.

Ray

Ray Osborn

unread,
May 19, 2016, 12:54:56 PM5/19/16
to conda - Public
I've just spent nearly two hours trying to understand this problem, chasing a few red herrings on the way. I hadn't realized that Anaconda seems to install pyside by default, so it was a while before I realized that `jupyter qtconsole` only worked because it was using PySide. When I removed PySide (`conda remove pyside`), we got the same error message we got before:

$ jupyter qtconsole
Traceback (most recent call last):
  File "/Users/tevelthu/Applications/anaconda/bin/jupyter-qtconsole", line 2, in <module>
    from qtconsole.qtconsoleapp import main
  File "/Users/tevelthu/Applications/anaconda/lib/python2.7/site-packages/qtconsole/qtconsoleapp.py", line 60, in <module>
    from qtconsole.qt import QtCore, QtGui
  File "/Users/tevelthu/Applications/anaconda/lib/python2.7/site-packages/qtconsole/qt.py", line 23, in <module>
    QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
  File "/Users/tevelthu/Applications/anaconda/lib/python2.7/site-packages/qtconsole/qt_loaders.py", line 290, in load_qt
    result = loaders[api]()
  File "/Users/tevelthu/Applications/anaconda/lib/python2.7/site-packages/qtconsole/qt_loaders.py", line 192, in import_pyqt4
    from PyQt4 import QtGui, QtCore, QtSvg
RuntimeError: the sip module implements API v8.0 to v8.1 but the PyQt4.QtGui module requires API v11.2

One puzzle is that when I typed `sip -V` from the terminal, I got `4.16.9`, but when I imported it in Python, `sip.SIP_VERSION_STR` gave `4.12.1`, even though `sip.__file__` pointed to the correct site-packages directory. I suspect this is a bug in the binary sip library, because the `sipconfig.py` file has the correct version number.

Ray Osborn

unread,
May 19, 2016, 12:58:04 PM5/19/16
to conda - Public
I had nearly completed the above post when my colleague came back to say that she had successfully run nexpy when she reinstalled Anaconda using the command-line installer, rather than the graphical installer. Also there was no discrepancies between the sip version numbers between 'sip -V' and sip.SIP_VERSION_STR within a Python shell. 

Could it be that the sip.so file that is distributed with the graphical installer is the incorrect one?
Reply all
Reply to author
Forward
0 new messages