MCPcopy
hub / github.com/jazzband/pip-tools / get_sys_path_for_python_executable

Function get_sys_path_for_python_executable

piptools/utils.py:425–436  ·  view source on GitHub ↗

Return sys.path list for the given python executable.

(python_executable: str)

Source from the content-addressed store, hash-verified

423
424
425def get_sys_path_for_python_executable(python_executable: str) -> list[str]:
426 """
427 Return sys.path list for the given python executable.
428 """
429 result = _subprocess.run_python_snippet(
430 python_executable, "import sys;import json;print(json.dumps(sys.path))"
431 )
432
433 paths = json.loads(result)
434 assert isinstance(paths, list)
435 assert all(isinstance(i, str) for i in paths)
436 return [os.path.abspath(path) for path in paths]
437
438
439def omit_list_value(lst: list[_T], value: _T) -> list[_T]:

Callers 2

cliFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…