# Qt4 plugins are bundled as data files (see hooks/hook-PyQt4*), # within a "qt4_plugins" directory. # We add a runtime hook to tell Qt4 where to find them. import os import sys d = "qt4_plugins" if "_MEIPASS2" in os.environ: d = os.path.join(os.environ["_MEIPASS2"], d) else: d = os.path.join(os.path.dirname(sys.argv[0]), d) # We remove QT_PLUGIN_PATH variable, beasuse we want Qt4 to load # plugins only from one path. if 'QT_PLUGIN_PATH' in os.environ: del os.environ['QT_PLUGIN_PATH'] # We cannot use QT_PLUGIN_PATH here, because it would not work when # PyQt4 is compiled with a different CRT from Python (eg: it happens # with Riverbank's GPL package). from PyQt4.QtCore import QCoreApplication # We set "qt4_plugins" as only one path for Qt4 plugins QCoreApplication.setLibraryPaths([os.path.abspath(d)])
# Qt4 plugins are bundled as data files (see hooks/hook-PyQt4*), # within a "qt4_plugins" directory. # We add a runtime hook to tell Qt4 where to find them. import os import sys d = "qt4_plugins" d = os.path.join(sys._MEIPASS, d) # We remove QT_PLUGIN_PATH variable, beasuse we want Qt4 to load # plugins only from one path. if 'QT_PLUGIN_PATH' in os.environ: del os.environ['QT_PLUGIN_PATH'] # We cannot use QT_PLUGIN_PATH here, because it would not work when # PyQt4 is compiled with a different CRT from Python (eg: it happens # with Riverbank's GPL package). from PyQt4.QtCore import QCoreApplication # We set "qt4_plugins" as only one path for Qt4 plugins QCoreApplication.setLibraryPaths([os.path.abspath(d)])
#! /usr/bin/env python from __future__ import print_function, division, absolute_import import sys import os.path import os sys.argv.append('--nodebug') if sys.platform == 'win32': sp = os.path.join(os.path.abspath('.'),'site-packages') sys.path.insert(0,sp) os.environ["PATH"] = "%s;%s" % (os.path.join(sp, "PyQt4", "bin"), os.environ["PATH"]) from PyQt4.QtCore import QCoreApplication lp = QCoreApplication.libraryPaths() lp << os.path.join(os.path.abspath('.'), 'site-packages', 'PyQt4', 'plugins') QCoreApplication.setLibraryPaths(lp) from point_tracker import tracking def run(): return tracking.ipython() if __name__ == "__main__": if "interactive" in sys.argv: print("Starting interactive session") app, main_win = tracking.ipython() else: tracking.run()