mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
start.py has defined global variable BUILD_ROOT
This commit is contained in:
parent
a24c0d1a37
commit
f538e74163
1 changed files with 10 additions and 3 deletions
13
start.py
13
start.py
|
|
@ -101,10 +101,17 @@ import subprocess
|
|||
import site
|
||||
from pathlib import Path
|
||||
|
||||
# add dependencies folder to sys.pat for frozen code
|
||||
if getattr(sys, 'frozen', False):
|
||||
# BUILD_ROOT is variable pointing to build (or code) directory
|
||||
if not getattr(sys, 'frozen', False):
|
||||
# Code root defined by `start.py` directory
|
||||
BUILD_ROOT = os.path.dirname(os.path.abspath(__file__))
|
||||
else:
|
||||
BUILD_ROOT = os.path.dirname(sys.executable)
|
||||
|
||||
# add dependencies folder to sys.pat for frozen code
|
||||
frozen_libs = os.path.normpath(
|
||||
os.path.join(os.path.dirname(sys.executable), "dependencies"))
|
||||
os.path.join(BUILD_ROOT, "dependencies")
|
||||
)
|
||||
sys.path.append(frozen_libs)
|
||||
# add stuff from `<frozen>/dependencies` to PYTHONPATH.
|
||||
pythonpath = os.getenv("PYTHONPATH", "")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue