Как вызывать свежий питон в кьют вместо дефолтного кутэшного
Форум — Development
Вызываю питон скрипт в консоли
...
QProcessEnvironment env =QProcessEnvironment::systemEnvironment();
env.insert("PYTHONHOME", "..\\Python\\Python312\\");
env.insert("PYTHONPATH", "..\\Python\\Python312\\Lib\\site-packages");
QProcess myProcess;
myProcess.setProcessEnvironment(env);
QString com = "..\\Python\\Python312\\python.exe main.py";
if (myProcess.execute(com)!=0) {
qDebug()<<"error";
...
}
PYTHONHOME = '..\QT\Tools\mingw\bin\..\opt'
PYTHONPATH = (not set)
program name = '..\Python\Python312\python.exe'
isolated = 0
environment = 1
user site = 1
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = '..\QT\Tools\mingw\opt\Lib'
sys._base_executable = '..\\Python\\Python312\\python.exe'
sys.base_prefix = '..\\QT\\Tools\\mingw\\bin\\..\\opt'
sys.base_exec_prefix = '..\\QT\\Tools\\mingw\\bin\\..\\opt'
sys.platlibdir = 'DLLs'
sys.executable = '..\\Python\\Python312\\python.exe'
sys.prefix = '..\\QT\\Tools\\mingw\\bin\\..\\opt'
sys.exec_prefix = '..\\QT\\Tools\\mingw\\bin\\..\\opt'
sys.path = [
'..\\Python\\Python312\\python312.zip',
'..\\QT\\Tools\\mingw\\opt\\DLLs',
'..\\QT\\Tools\\mingw\\opt\\Lib',
'..\\Python\\Python312',
]
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'
Current thread 0x00001b70 (most recent call first):
<no Python frame>
error