MCPcopy Index your code
hub / github.com/deepnote/deepnote / findPythonInDirectory

Function findPythonInDirectory

packages/runtime-core/src/python-env.ts:91–100  ·  view source on GitHub ↗

* Finds a Python executable in the given directory.

(dir: string, candidates: string[])

Source from the content-addressed store, hash-verified

89 * Finds a Python executable in the given directory.
90 */
91async function findPythonInDirectory(dir: string, candidates: string[]): Promise<string | null> {
92 for (const candidate of candidates) {
93 const pythonPath = join(dir, candidate)
94 const pythonStat = await stat(pythonPath).catch(() => null)
95 if (pythonStat?.isFile()) {
96 return pythonPath
97 }
98 }
99 return null
100}
101
102/**
103 * Detects the default Python command available on the system.

Callers 1

resolvePythonExecutableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected