Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions electron/src/python/uv.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,28 @@ export class UV {
pythonVersion = `cpython-${pythonVersion}-macos-x86_64-none`
}
// make a new venv
await this.execTracked([
"venv", folder, "--python", pythonVersion, "--clear"
])
try {
await this.execTracked([
"venv", folder, "--python", pythonVersion, "--clear"
])
} catch (err) {
// on Mac, we might need to install Rosetta first
if (err.code === 86) {
// install Rosetta
await execTracked(
"UV",
"/usr/sbin/softwareupdate",
["--install-rosetta", "--agree-to-license"]
)
// make venv again - this time with Rosetta
await this.execTracked([
"venv", folder, "--python", pythonVersion, "--clear"
])
} else {
throw err
}
}

// return its path
return this.findPython(psychopyVersion)
}
Expand Down