From ea7ca4ac8e4ab8adde8c909c0adef90f4341062a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 11 Apr 2018 18:44:05 +0200 Subject: Add installed package directory to PATH on Windows This makes sure that all shared libraries like plugins and qml plugins are able to find the Qt libraries they depend on. Task-number: PYSIDE-642 Change-Id: I0f54481c089dfdbc69a9098f2768f98b1e7a9a22 Reviewed-by: Friedemann Kleint --- sources/pyside2/PySide2/__init__.py.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sources/pyside2') diff --git a/sources/pyside2/PySide2/__init__.py.in b/sources/pyside2/PySide2/__init__.py.in index 4ce266b69..f33b05e31 100644 --- a/sources/pyside2/PySide2/__init__.py.in +++ b/sources/pyside2/PySide2/__init__.py.in @@ -20,10 +20,16 @@ def _setupQtDirectories(): # Used by signature module. os.environ["PYSIDE_PACKAGE_DIR"] = pyside_package_dir - # On Windows add the PySide2\openssl folder (if it exists) to the - # PATH so that the SSL DLLs can be found when Qt tries to dynamically - # load them. Tell Qt to load them and then reset the PATH. if sys.platform == 'win32': + # PATH has to contain the package directory, otherwise plugins + # won't be able to find their required Qt libraries (e.g. the + # svg image plugin won't find Qt5Svg.dll). + os.environ['PATH'] = pyside_package_dir + ";" + os.environ['PATH'] + + # On Windows add the PySide2\openssl folder (if it exists) to + # the PATH so that the SSL DLLs can be found when Qt tries to + # dynamically load them. Tell Qt to load them and then reset + # the PATH. openssl_dir = os.path.join(pyside_package_dir, 'openssl') if os.path.exists(openssl_dir): path = os.environ['PATH'] -- cgit v1.2.3