Uh oh!
There was an error while loading. Please reload this page.
forked from alicevision/Meshroom
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetupInitScriptWindows.py
More file actions
Latest commit
35 lines (30 loc) · 1.24 KB
/
Copy pathsetupInitScriptWindows.py
File metadata and controls
35 lines (30 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
importos
importsubprocess
importsys
importzipimport
FILE_NAME=sys.executable
DIR_NAME=os.path.dirname(sys.executable)
paths=os.environ.get("ALICEVISION_LIBPATH", "").split(os.pathsep)
ifDIR_NAMEnotinpaths:
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", "bin"))
os.environ["ALICEVISION_LIBPATH"] =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")
sys.exit(subprocess.call([sys.executable] +sys.argv[1:]))
sys.frozen=True
sys.path=sys.path[:5]
defrun(*args):
m=__import__("__main__")
importer=zipimport.zipimporter(DIR_NAME+"/lib/library.zip")
iflen(args) ==0:
name, ext=os.path.splitext(os.path.basename(os.path.normcase(FILE_NAME)))
moduleName="%s__main__"%name
else:
moduleName=args[0]
pythonPaths=os.getenv("PYTHONPATH", "").split(os.pathsep)
forpinpythonPaths:
sys.path.append(p)
code=importer.get_code(moduleName)
exec(code, m.__dict__)