Skip to content

Commit c0b20f3

Browse files
committed
fix(installer): prioritize user-installed packages over server-libs
Change sys.path.insert(0, ...) to sys.path.append(...) for server site-packages so user-installed packages in system site-packages take precedence over bundled server-libs packages. Previously, server-libs were inserted at the front of sys.path, causing bundled versions to override user-installed versions (e.g., streamlit).
1 parent 3afc8fa commit c0b20f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

installer/module/virtual_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def import_package_bundle(
9797
# Write conditional import that checks environment variable
9898
pth_content = (
9999
f"import os, sys; "
100-
f"sys.path.insert(0, '{bundle_site_package_path}') "
100+
f"sys.path.append('{bundle_site_package_path}') "
101101
f"if os.environ.get('{condition_env}', '').lower() == 'true' else None"
102102
)
103103
pth_file.write(pth_content + "\n")

0 commit comments

Comments
 (0)