setupInitScriptWindows : Add OIIO to PYTHONPATH
# ------------------------------------------------------------------------------# ConsoleSetLibPath.py# Initialization script for cx_Freeze which manipulates the path so that the# directory in which the executable is found is searched for extensions but# no other directory is searched. The environment variable LD_LIBRARY_PATH is# manipulated first, however, to ensure that shared libraries found in the# target directory are found. This requires a restart of the executable because# the environment variable LD_LIBRARY_PATH is only checked at startup.# ------------------------------------------------------------------------------import osimport sysimport zipimportFILE_NAME = sys.executableDIR_NAME = os.path.dirname(sys.executable)paths = os.environ.get("LD_LIBRARY_PATH", "").split(os.pathsep)if DIR_NAME not in paths:paths.insert(0, DIR_NAME)paths.insert(0, os.path.join(DIR_NAME, "lib"))paths.insert(0, os.path.join(DIR_NAME, "aliceVision", "lib"))paths.insert(0, os.path.join(DIR_NAME, "aliceVision", "lib64"))paths.insert(0, os.path.join(DIR_NAME, "lib", "PySide6", "Qt", "qml", "QtQuick", "Dialogs"))os.environ["LD_LIBRARY_PATH"] = os.pathsep.join(paths)os.environ["PYTHONPATH"] = os.path.join(DIR_NAME, "aliceVision", "lib", "python") + os.pathsep + os.path.join(DIR_NAME, "aliceVision", "lib", "python3.11", "site-packages")os.execv(sys.executable, sys.argv)sys.frozen = Truesys.path = sys.path[:6]def run(*args):m = __import__("__main__")importer = zipimport.zipimporter(DIR_NAME + "/lib/library.zip")if len(args) == 0:name, ext = os.path.splitext(os.path.basename(os.path.normcase(FILE_NAME)))moduleName = "%s__main__" % nameelse:moduleName = args[0]pythonPaths = os.getenv("PYTHONPATH", "").split(os.pathsep)for p in pythonPaths:sys.path.append(p)code = importer.get_code(moduleName)exec(code, m.__dict__)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。