Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
fix how runtime dependencies are added to sys.path
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Jan 22, 2024
1 parent b9106f9 commit 2fbe0de
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion start.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,21 @@
# Vendored python modules that must not be in PYTHONPATH environment but
# are required for OpenPype processes
vendor_python_path = os.path.join(OPENPYPE_ROOT, "vendor", "python")
sys.path.insert(0, vendor_python_path)
runtime_site_packages = []
if platform.system().lower() == "windows":
runtime_site_packages.append(os.path.join(
vendor_python_path, "Lib", "site-packages"
))
else:
lib_dir = os.path.join(vendor_python_path, "lib")
# linux and macos create python{x}.{y} subfolder with 'site-packages'
for name in os.listdir(lib_dir):
site_packages = os.path.join(lib_dir, name, "site-packages")
if os.path.exists(site_packages):
runtime_site_packages.append(site_packages)

for runtime_site_package in runtime_site_packages:
sys.path.insert(0, runtime_site_package)

# Add common package to sys path
# - common contains common code for bootstraping and OpenPype processes
Expand Down

0 comments on commit 2fbe0de

Please sign in to comment.