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

Function detectDefaultPython

packages/runtime-core/src/python-env.ts:109–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 * @throws Error if neither python nor python3 is found
108 */
109export function detectDefaultPython(): string {
110 if (isPythonAvailable('python')) {
111 return 'python'
112 }
113
114 if (isPythonAvailable('python3')) {
115 return 'python3'
116 }
117
118 throw new Error(
119 'No Python executable found.\n\n' +
120 'Please ensure Python is installed and available in your PATH,\n' +
121 'or specify the path explicitly with --python <path>'
122 )
123}
124
125/**
126 * Checks if the given string is a bare system Python command (e.g. 'python', 'python3', 'python3.11')

Callers 3

setupProjectFunction · 0.90
python-env.test.tsFile · 0.90
run.test.tsFile · 0.85

Calls 1

isPythonAvailableFunction · 0.85

Tested by

no test coverage detected