Skip to content

Commit b7badfe

Browse files
committed
fix: remove debian path from sys.path
1 parent cbb688f commit b7badfe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

projects/extension/build.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,14 @@ def build_idempotent_sql_file(input_file: Path) -> str:
786786
# This seems paranoid, but it was a real problem.
787787
if "purelib" in sysconfig.get_path_names() and sysconfig.get_path("purelib") in sys.path:
788788
sys.path.remove(sysconfig.get_path("purelib"))
789+
# Debian based systems have their own convention and install some
790+
# packages in a dist-packages directory.
791+
system_paths_to_remove = [
792+
'/usr/lib/python3/dist-packages',
793+
]
794+
for path in system_paths_to_remove:
795+
if path in sys.path:
796+
sys.path.remove(path)
789797
python_lib_dir = Path(python_lib_dir).joinpath("{this_version()}")
790798
import site
791799
site.addsitedir(str(python_lib_dir))

0 commit comments

Comments
 (0)