Explorar o código

Import python's site module for local config

For example, on debian/ubuntu, the site module
defines that dist-packages from easy_install
are located in /usr/local/lib/pythonX.Y rather
than in /usr/lib/pythonX.Y where all the other
python files are installed.
Steve Pieper %!s(int64=13) %!d(string=hai) anos
pai
achega
610e80693a
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      Libs/Scripting/Python/Core/ctkAbstractPythonManager.cpp

+ 2 - 0
Libs/Scripting/Python/Core/ctkAbstractPythonManager.cpp

@@ -100,6 +100,8 @@ void ctkAbstractPythonManager::initPythonQt()
     initCode << QString("sys.path.append('%1')").arg(QDir::fromNativeSeparators(path));
     }
 
+  initCode << QString("import site");
+
   _mainContext.evalScript(initCode.join("\n"));
 
   this->preInitialization();