Skip to content

ENH: skip PythonQt imports in non-embedded Python interpreter

Isaiah requested to merge github/fork/ihnorton/safe_import_realpython into master

This allows to import slicer when running Slicer's python as a stand-alone executable, by avoiding the segfault while attempting to initialize PythonQt (during Qt library self-registration).

concretely:

$ source /tmp/s5env # from launcher-dump-env... $ /opt/bld/s5nj/python-install/bin/python

In [1]: import slicer Detected non-embedded Python interpreter. Skipping module 'qMRMLWidgetsPythonQt' Detected non-embedded Python interpreter. Skipping module 'qSlicerBaseQTCorePythonQt' Detected non-embedded Python interpreter. Skipping module 'qSlicerBaseQTGUIPythonQt' Detected non-embedded Python interpreter. Skipping module 'qSlicerBaseQTAppPythonQt' Detected non-embedded Python interpreter. Skipping module 'qSlicerBaseQTCLIPythonQt'

In [2]:

Merge request reports

Loading