# Buggy code
def get_versions(reporev=True):
    """Get version information for components used by Spyder"""
    import sys
    import platform

    # Hack to let IPython set QT_API, in case it's installed
    try:
        from IPython.external import qt  # analysis:ignore
    except (ImportError, ValueError):
        pass
    import spyderlib.qt
    import spyderlib.qt.QtCore

    revision = None
    if reporev:
        from spyderlib.utils import vcs

        revision = vcs.get_git_revision(os.path.dirname(__dir__))

    if not sys.platform == "darwin":  # To avoid a crash with our Mac app
        system = platform.system()
    else:
        system = "Darwin"

    return {
        "spyder": __version__,
        "python": platform.python_version(),  # "2.7.3"
        "bitness": 64 if sys.maxsize > 2**32 else 32,
        "qt": spyderlib.qt.QtCore.__version__,
        "qt_api": spyderlib.qt.API_NAME,  # PySide or PyQt4
        "qt_api_ver": spyderlib.qt.__version__,
        "system": system,  # Linux, Windows, ...
        "revision": revision,  # '9fdf926eccce'
    }


# Traceback (ImportError)
/home/hadyan/anaconda/lib/python2.7/site-packages/IPython/qt.py:13: ShimWarning: The `IPython.qt` package has been deprecated. You should import from qtconsole instead.
"You should import from qtconsole instead.", ShimWarning)
Traceback (most recent call last):
File "/home/hadyan/anaconda/lib/python2.7/site-packages/spyderlib/spyder.py", line 2336, in main
mainwindow = run_spyder(app, options, args)
File "/home/hadyan/anaconda/lib/python2.7/site-packages/spyderlib/spyder.py", line 2220, in run_spyder
main.setup()
File "/home/hadyan/anaconda/lib/python2.7/site-packages/spyderlib/spyder.py", line 766, in setup
from spyderlib.plugins.inspector import ObjectInspector
File "/home/hadyan/anaconda/lib/python2.7/site-packages/spyderlib/plugins/inspector.py", line 41, in <module>
from spyderlib.widgets.ipython import IPythonControlWidget
File "/home/hadyan/anaconda/lib/python2.7/site-packages/spyderlib/widgets/ipython.py", line 28, in <module>
pygments_patch.apply()
File "/home/hadyan/anaconda/lib/python2.7/site-packages/spyderlib/pygments_patch.py", line 27, in apply
from IPython.frontend.qt.console.pygments_highlighter import RegexLexer
ImportError: No module named pygments_highlighter
Segmentation fault (core dumped)

# Fixed code
def get_versions(reporev=True):
    """Get version information for components used by Spyder"""
    import sys
    import platform
    import spyderlib.qt
    import spyderlib.qt.QtCore

    revision = None
    if reporev:
        from spyderlib.utils import vcs

        revision = vcs.get_git_revision(os.path.dirname(__dir__))

    if not sys.platform == "darwin":  # To avoid a crash with our Mac app
        system = platform.system()
    else:
        system = "Darwin"

    return {
        "spyder": __version__,
        "python": platform.python_version(),  # "2.7.3"
        "bitness": 64 if sys.maxsize > 2**32 else 32,
        "qt": spyderlib.qt.QtCore.__version__,
        "qt_api": spyderlib.qt.API_NAME,  # PySide or PyQt4
        "qt_api_ver": spyderlib.qt.__version__,
        "system": system,  # Linux, Windows, ...
        "revision": revision,  # '9fdf926eccce'
    }