fix: 修复 Linux 一键安装脚本执行失败问题 (#2142)

安装 pyopenjtalk 库时不仅要保证 gcc 版本不高于 14,同时在执行 pip install -r requirements.txt 前需要保证环境变量中更新刚刚安装的 gcc/g++/cmake。
因此在安装三者后补充了设置环境变量,并且用 hash -r 确保生效
This commit is contained in:
Fridemn 2025-03-04 14:10:37 +08:00 committed by GitHub
parent df33574a26
commit bb8a8efeca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,21 @@
#!/bin/bash
# 安装构建工具
# Install build tools
conda install -c conda-forge gcc=14
conda install -c conda-forge gxx
conda install ffmpeg cmake
# 设置编译环境
# Set up build environment
export CMAKE_MAKE_PROGRAM="$CONDA_PREFIX/bin/cmake"
export CC="$CONDA_PREFIX/bin/gcc"
export CXX="$CONDA_PREFIX/bin/g++"
conda install pytorch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 pytorch-cuda=11.8 -c pytorch -c nvidia
pip install -r requirements.txt
# 刷新环境
# Refresh environment
hash -r
pip install -r requirements.txt