From 05db21e661c6ba9eb69516cb1386bcbd431b7d2d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 5 Jan 2021 13:40:25 +0100 Subject: scriptable application/Unix: Remove setting of PYTHONHOME for virtualenv On Linux, with 3.8, it causes an error in conjunction with virtualenv: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings' Pick-to: 6.0 Pick-to: 5.15 Task-number: PYSIDE-841 Change-Id: Ibf1caa1a797faab5dd8e4bfa6eb23296bb7945a5 Reviewed-by: Christian Tismer --- examples/scriptableapplication/pythonutils.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'examples/scriptableapplication/pythonutils.cpp') diff --git a/examples/scriptableapplication/pythonutils.cpp b/examples/scriptableapplication/pythonutils.cpp index c5e18f256..eef2fada7 100644 --- a/examples/scriptableapplication/pythonutils.cpp +++ b/examples/scriptableapplication/pythonutils.cpp @@ -94,14 +94,12 @@ static const char virtualEnvVar[] = "VIRTUAL_ENV"; // packages location. static void initVirtualEnvironment() { - QByteArray virtualEnvPath = qgetenv(virtualEnvVar); // As of Python 3.8, Python is no longer able to run stand-alone in a // virtualenv due to missing libraries. Add the path to the modules instead. if (QOperatingSystemVersion::currentType() == QOperatingSystemVersion::Windows && (PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 8))) { + const QByteArray virtualEnvPath = qgetenv(virtualEnvVar); qputenv("PYTHONPATH", virtualEnvPath + "\\Lib\\site-packages"); - } else { - qputenv("PYTHONHOME", virtualEnvPath); } } -- cgit v1.2.3