1
1
mirror of https://github.com/leon-ai/leon.git synced 2025-01-07 18:26:40 +03:00

feat(scripts): auto delete .venv when Python packages failed to be installed on setup

This commit is contained in:
louistiti 2024-06-01 23:23:00 +08:00
parent e9f1aadc67
commit eb72065e5e
No known key found for this signature in database
GPG Key ID: 92CD6A2E497E1669

View File

@ -236,6 +236,11 @@ SPACY_MODELS.set('fr', {
await installPytorch()
} catch (e) {
if (hasDotVenv) {
await fs.promises.rm(dotVenvPath, { recursive: true, force: true })
LogHelper.info(`Error occurred, so "${dotVenvPath}" was deleted`)
}
LogHelper.error(`Failed to install Python packages: ${e}`)
if (osType === OSTypes.Linux || osType === OSTypes.MacOS) {