From b6ec4eab0d9bcfc01d73fbb8f576dfff4a000e88 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 2 Nov 2022 11:08:57 +0100 Subject: Qt Designer: Fix loading the custom widgets in virtual env on Windows when base Python is not in path Add sys._base_executable to the path. Pick-to: 6.4 6.2 Change-Id: I08154453d6a0b4565e9aff8d46bf6950b20ef5ce Reviewed-by: Cristian Maureira-Fredes --- sources/pyside-tools/pyside_tool.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sources/pyside-tools/pyside_tool.py') diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py index f442ee254..a70f26d24 100644 --- a/sources/pyside-tools/pyside_tool.py +++ b/sources/pyside-tools/pyside_tool.py @@ -129,6 +129,10 @@ def designer(): framework_prefix = sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX") lib_path = os.fspath(Path(framework_prefix) / library_name) os.environ['DYLD_INSERT_LIBRARIES'] = lib_path + elif sys.platform == 'win32': + # Find Python DLLs from the base installation + if os.environ.get("VIRTUAL_ENV"): + _append_to_path_var("PATH", os.fspath(Path(sys._base_executable).parent)) # Add the Wiggly Widget example wiggly_dir = os.fspath(pyside_dir / 'examples' / 'widgetbinding') _append_to_path_var('PYSIDE_DESIGNER_PLUGINS', wiggly_dir) -- cgit v1.2.3